mahbod72 Posted July 8, 2015 Report Share Posted July 8, 2015 Hi I want to design basic computer with systemc and I faced a problem in my code. The common bus of yhe basic computer is 16 bit and the address register is 12 bit. When i instantiate address register i don’t know how to connect 12 bit to 16 bit. AR = new reg12bit ("AR"); (*AR) (inc_ar,ld_ar,clr_ar,bus,ar2buf,clk); in the above Piece code the output of my register is 12 bit and the bus is 16 bit. my idea is i use .range() but .range() just used for variables not ports or signals. please help me. Quote Link to comment Share on other sites More sharing options...
apfitch Posted July 8, 2015 Report Share Posted July 8, 2015 The simplest way is to write a process (SC_METHOD) to copy the values across, e.g. SC_METHOD(copier); sensitive << bus; void copier() { myreg = bus.read().range(11,0); } Alternatively have a look at the sc_vector introduced in the SystemC 1666-2011 standard, which was introduced to solve this kind of problem, regards Alan Quote Link to comment Share on other sites More sharing options...
mahbod72 Posted July 8, 2015 Author Report Share Posted July 8, 2015 thank you very much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.