Jump to content

Search the Community

Showing results for tags 'submodule'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Accellera Systems Initiative
    • Information
    • Announcements
    • In the News
  • SystemC
    • SystemC Language
    • SystemC AMS (Analog/Mixed-Signal)
    • SystemC TLM (Transaction-level Modeling)
    • SystemC Verification (UVM-SystemC, SCV, CRAVE, FC4SC)
    • SystemC CCI (Configuration, Control & Inspection)
    • SystemC Datatypes
  • UVM (Universal Verification Methodology)
    • UVM (IEEE 1800.2) - Methodology and BCL Forum
    • UVM SystemVerilog Discussions
    • UVM Simulator Specific Issues
    • UVM Commercial Announcements
    • UVM (Pre-IEEE) Methodology and BCL Forum
  • Portable Stimulus
    • Portable Stimulus Discussion
    • Portable Stimulus 2.0 Public Review Feedback
  • IP Security
    • SA-EDI Standard Discussion
    • IP Security Assurance Whitepaper Discussion
  • IP-XACT
    • IP-XACT Discussion
  • SystemRDL
    • SystemRDL Discussion
  • IEEE 1735/IP Encryption
    • IEEE 1735/IP Encryption Discussion
  • Commercial Announcements
    • Announcements

Categories

  • SystemC
  • UVM
  • UCIS
  • IEEE 1735/IP Encryption

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Biography


Location


Interests


Occupation


Company

Found 2 results

  1. Hi, I have two files. In header file I have two modules `camkii` and `camkii_ring`. The `camkii_ring` contains N number of `camkii` submodule. I thought of using std::vector to instantiate the submodules. See the code below. #ifndef CAMKII_H #define CAMKII_H #include <systemc.h> #include <vector> using namespace std; SC_MODULE(camkii) { sc_in_clk clock; sc_in<double> ca_conc_in; sc_signal<double> v1, v2, v3; void init() { cout << "[Ca] " << ca_conc_in << endl; //cout << sc_get_time_resolution() << endl; } void compute_rate() { // do something } SC_CTOR(camkii) { init(); SC_METHOD(compute_rates); sensitive << clock.pos(); } }; /* * This module is a ring of CamKII holoenzyme. It has total of 6 camkii * holoenzymes. */ SC_MODULE( camkii_ring ) { sc_in_clk clock; sc_in<double> ca_in; /* It has 6 subunits of holoenzymes */ vector<camkii*> subunits; void init() { for( int i = 0; i < 6; i++) { stringstream name; name << "sub" << i; camkii* c = new camkii(name.str().c_str()); c->clock(clock); c->ca_conc_in(ca_in); subunits.push_back(c); } } void compute() { } SC_CTOR(camkii_ring) { init(); SC_METHOD(compute); sensitive << clock.pos(); } }; #endif /* end of include guard: CAMKII_H */ And here is my main.cc file. #include "camkii.h" #include <systemc.h> #include <iostream> using namespace std; int sc_main(int argc, char** argv) { sc_clock clock_("GlobalClock", 10, SC_MS, 0.5); sc_signal<double> ca_conc, i1p_conc; sc_signal<double> camkii_out; /* connect the camkii ring to ports */ camkii_ring camkii_ring("cakii_ring"); camkii_ring.clock(clock_); camkii_ring.ca_in(ca_conc); cout << "Starting ..." << endl; sc_start(100, SC_MS); return 1; } It compiles fine but when I run it Error: (E112) get interface failed: port is not bound: port 'cakii_ring.sub0.port_1' (sc_in) In file: sc_port.cpp:230
  2. Hello, I've been trying to instantiate (if I'm not mistaken) an array of submodules that were created using sc_vector. So far, I've followed the recommendations for using custom creator functions, but I'm kind of lost at how to actually make it work. Especially with sc_bind, which keeps returning me errors. The module master houses an array of ports that will be connected to a corresponding number of slaves. Order of connection does not matter. I'm using MSVC++ 10. The code is as follows: class top : public sc_module { //Submodule declarations master master_i; sc_vector<slave> slave_i; public: // Constructor top( sc_module_name module_name , int k ) : sc_module( module_name ) , master_i("master"), slave_i("slave") { slave_i.init(N_SLAVE, sc_bind(&top::create_slave, this, sc_unnamed::_1, sc_unnamed::_2)("slave",k)); sc_assemble_vector(slave_i, &slave::target_port).bind(master_i.initiator_port); } The creator function, which is a member of the class top, is as follows: static slave* top::create_slave(const char* name, size_t idx) { slave* s = new slave(name,1); // Hardcoding not intended; it's just to get it to // compile return s; } slave class constructor prototype: slave( sc_module_name module_name , int k ); Errors that I have so far: 1>c:\systemc\systemc-2.3.1\src\sysc\packages\boost\bind.hpp(63): error C2825: 'F': must be a class or namespace when followed by '::' 1> c:\systemc\systemc-2.3.1\src\sysc\packages\boost\bind\bind_template.hpp(15) : see reference to class template instantiation 'sc_boost::_bi::result_traits<R,F>' being compiled 1> with 1> [ 1> R=sc_boost::_bi::unspecified, 1> F=slave *(__cdecl *)(const char *,size_t) 1> ] 1> c:\users\khairul\dropbox\cours\systemc\examples\source\11\master_slave\top.h(32) : see reference to class template instantiation 'sc_boost::_bi::bind_t<R,F,L>' being compiled 1> with 1> [ 1> R=sc_boost::_bi::unspecified, 1> F=slave *(__cdecl *)(const char *,size_t), 1> L=sc_boost::_bi::list3<sc_boost::_bi::value<top *>,sc_boost::arg<1>,sc_boost::arg<2>> 1> ] Any ideas? Thanks,
×
×
  • Create New...