c++


Error: (E107) bind interface to port failed: interface already bound to port: port 'MC8051_ALU().AM.port_27' (sc_in)


hello I am new to systemc. I am assigned a task of connecting all lower modules of alu of 8051(ie addsub,mutliplier,divider). I have written code which is compiling without any error but when i run object file I get the following error
Error: (E107) bind interface to port failed: interface already bound to port: port 'MC8051_ALU().AM.port_27' (sc_in)
this is mc8051_alu().cpp file
#include "systemc.h"
#include <alumux.h>
#include <addsub_core.h>
#include <comb_mltplr.h>
#include <comb_divider.h>
#include <dcml_adjust.h>
SC_MODULE(mc8051_alu) {
//inputs of the block
sc_in< sc_bv<8> > rom_data_i,ram_data_i,acc_i;
sc_in< sc_bv<6> > cmd_i;
sc_in< sc_bv<2> > cy_i;
sc_in< sc_bv<1> > ov_i;
//outs of th block
sc_out< sc_bv<1> > new_ov_o;
sc_out< sc_bv<2> > new_cy_o;
sc_out< sc_bv<8> > result_a_o,result_b_o;
//making an instance of every block
//intrtnal signal of the block to connect the units alumux, addsub_core, alucore,_comb_mltplr,comb_divider and decimal_adjust together.
sc_signal< sc_bv<8> > s_alu_result;
sc_signal< sc_bv<2> > s_alu_new_cy;
sc_signal< sc_bv<8> > s_alu_op_a;
sc_signal< sc_bv<8> > s_alu_op_b;
sc_signal< sc_bv<4> > s_alu_cmd;
sc_signal< sc_bv<8> > s_dvdnd;
sc_signal< sc_bv<8> > s_dvsor;
sc_signal< sc_bv<8> > s_qutnt;
sc_signal< sc_bv<8> > s_rmndr;
sc_signal< sc_bv<8> > s_mltplcnd;
sc_signal< sc_bv<8> > s_mltplctr;
sc_signal< sc_bv<8> > s_product;
sc_signal< sc_bv<8> > s_dcml_data;
sc_signal< sc_bv<8> > s_dcml_rslt;
sc_signal< sc_bv<1> > s_dcml_cy;
sc_signal< sc_bv<8> > s_addsub_rslt;
sc_signal< sc_bv<2> > s_addsub_newcy;
sc_signal< sc_bv<1> > s_addsub_ov;
sc_signal< sc_bv<1> > s_addsub_cy;
sc_signal< sc_bv<1> > s_addsub;
sc_signal< sc_bv<8> > s_addsub_opa;
sc_signal< sc_bv<8> > s_addsub_opb;
//constructor of the module
SC_CTOR(mc8051_alu)
{
// connecting alumux inputs and outputs
alumux am("AM");
addsub_core asc("ASC");
comb_mltplr cm("CM");
comb_divider cd("CD");
dcml_adjust da("DA");
am.rom_data_i(rom_data_i);
am.ram_data_i(ram_data_i);
am.acc_i(acc_i);
am.cmd_i(cmd_i);
am.cy_i(cy_i);
am.ov_i(ov_i);
am.cy_o(new_cy_o);
am.ov_o(new_ov_o);
am.result_a_o(s_addsub_opa);
am.result_b_o(result_b_o);
am.result_i(s_alu_result);
am.new_cy_i(s_alu_new_cy);
am.addsub_rslt_i(s_addsub_rslt);
am.addsub_cy_i(s_addsub_newcy);
am.addsub_ov_i(s_addsub_ov);
am.op_a_o(s_alu_op_a);
am.op_b_o(s_alu_op_b);
am.alu_cmd_o(s_alu_cmd);
am.opa_o(s_addsub_opa);
am.opb_o(s_addsub_opb);
am.addsub_o(s_addsub);
am.addsub_cy_o(s_addsub_cy);
am.addsub_ov_i(s_addsub_ov);
am.dvdnd_o(s_dvdnd);
am.dvsor_o(s_dvsor);
am.qutnt_i(s_qutnt);
am.rmndr_i(s_rmndr);
am.mltplcnd_o(s_mltplcnd);
am.mltplctr_o(s_mltplctr);
am.product_i(s_product);
am.dcml_data_o(s_dcml_data);
am.dcml_data_i(s_dcml_rslt);
am.dcml_cy_i(s_dcml_cy);
// connecting alucore inputs and outputs
// ac.op_a_i(s_alu_op_a);
// ac.op_b_i(s_alu_op_b);
// ac.alu_cmd_i(s_alu_cmd);
// ac.cy_i(cy_i);
// ac.cy_o(s_alu_new_cy);
// ac.result_o(s_alu_result);
// connecting addsub_core inputs and outputs
asc.opa_i(result_a_o);
asc.opb_i(s_addsub_opb);
asc.addsub_i(s_addsub);
asc.cy_i(s_addsub_cy);
asc.cy_o(s_addsub_newcy);
asc.ov_o(s_addsub_ov);
asc.result_o(s_addsub_rslt);
// connecting comb_mltplr inputs and outputs
cm.mltplcnd_i(s_mltplcnd);
cm.mltplctr_i(s_mltplctr);
cm.product_o(s_product);
// connecting comb_divider inputs and outputs
cd.dvdnd_i(s_dvdnd);
cd.dvsor_i(s_dvsor);
cd.qutnt_o(s_qutnt);
cd.rmndr_o(s_rmndr);
// connecting dcml_adjust inputs and outputs
da.data_i(s_dcml_data);
da.cy_i(cy_i);
da.data_o(s_dcml_rslt);
da.cy_o(s_dcml_cy);
}
};
now when i want to run this by writing a testbench in main function i am getting above error
this is my main.cpp file
#include "systemc.h"
#include "mc8051_alu().cpp"
//#include "stim.h"
int sc_main (int argc, char* argv[]) {
sc_signal< sc_bv<6> > cmd_i; //= sc_uint<8>(1);
sc_signal< sc_bv<8> > result_a_o,result_b_o,rom_data_i,ram_data_i,acc_i;
sc_signal< sc_bv<2> > cy_i,new_cy_o;
sc_signal< sc_bv<1> > ov_i,new_ov_o;
mc8051_alu DUT("MC8051_ALU()");(//LINE WHERE ERROR IS COMING)
DUT.rom_data_i(rom_data_i);
DUT.ram_data_i(ram_data_i);
DUT.acc_i(acc_i);
DUT.cmd_i(cmd_i);
DUT.ov_i(ov_i);
DUT.cy_i(cy_i);
DUT.new_ov_o(new_ov_o);
DUT.new_cy_o(new_cy_o);
DUT.result_a_o(result_a_o);
DUT.result_b_o(result_b_o);
cmd_i= 0b010101;
sc_start(sc_time(1,SC_NS));
cout << "this is here"<< endl;
cout << cmd_i<< endl;
sc_stop();
return 0;
}

Related Links

Tree and its preorder traversal - Code error
Why is my 2D array of double not accepted as a valid parameter?
How to allow only numbers in a variable?
Copy iterator range to vector without duplication
Is it better to include <cassert> or <assert.h>? [duplicate]
Using an Array of pointers to copy a PPM Image
Avoiding virtual function calls in a computational graph
Null session pipes example, write access
Why does adding x + 1 skip 10?
Errors in prototype in C++ in XCode
C++ unordered set issue with struct hash [duplicate]
How to add cyclomatic complexity to sonar-cxx?
A pointer that can point to anywhere, how to determine if “delete” can be safely called on it?
Input will be floating value and program return whole part and decimal value
OpenDnp3 crosscompile tgo moxa UC8162LX segmentation fault at: epoll_reactor.hpp
Writing Memory to Process

Categories

HOME
videochat
processing
inno-setup
rx-java
accounting
mariadb
timezone
put
visual-foxpro
asp.net-web-api2
pstricks
vaadin-grid
c#-3.0
uinavigationcontroller
spring-transactions
vbulletin
bayesian
navbar
corba
mupdf
video.js
emu8086
dht
android-constraintlayout
httpsession
robots.txt
flip-flop
face-api
footable
dsolve
uppaal
polymer-starter-kit
wijmo5
eureka-forms
drools-fusion
post-build-event
jung
word
mpd
easymock
tablet
webmin
ngrx-effects
templating
notnull
auto-value
background-position
ole
ifttt
ctags
rufus-scheduler
masm
inputstreamreader
measurement-studio
case-class
webpack-style-loader
dependency-properties
android-gson
gyp
date-formatting
ch
turtle-rdf
z-order
ucp
gm
nested-function
deferred-loading
jquery-ui-resizable
sos
network-monitoring
ios9.3
adobe-dps
euclidean-distance
bitarray
du
typescript1.7
pysftp
streaminsight
savefiledialog
custom-validators
t4-toolbox
scrollviewer
grunt-contrib-cssmin
magnetometer
componentone
vtune
mooc
swift-protocols
ember.js-view
jml
ntl
mathgl
alassetslibrary
presentmodalviewcontrolle
inter-process-communicat
citrix-access-gateway
icommand
agi
hiding
outlook-2003
aspnet-regiis.exe
windmill
getprocaddress
dvorak
plcrashreporter
bionic
windows-live-writer
blogml
paint.net
whiteboard

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile