Jump to content

Search the Community

Showing results for tags 'sc_port'.



More search options

  • 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)
    • SystemC CCI (Configuration, Control & Inspection)
    • SystemC Datatypes
  • UVM (Universal Verification Methodology)
    • UVM 2017 - Methodology and BCL Forum
    • UVM SystemVerilog Discussions
    • UVM Simulator Specific Issues
    • UVM Commercial Announcements
    • UVM (Pre-IEEE) Methodology and BCL Forum
    • UVM 1.2 Public Review
  • Portable Stimulus
    • Portable Stimulus Pre-Release Discussion
    • Portable Stimulus 1.0
  • IP Security
    • IP Security Assurance Whitepaper Discussion
  • IP-XACT
    • IP-XACT Discussion
  • IEEE 1735/IP Encryption
    • IEEE 1735/IP Encryption Discussion
  • OCP (Open Core Protocol)
  • UCIS (Unified Coverage Interoperability Standard)
  • 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. I have an SC_MODULE that contains two types(probably multiple types in the future) of sc_out ports. I want to store a reference(or pointer) of the port in a std::map, so that I can later get the right port through lookup of strings and access the write method of it. Following post helped me understand the topic better but for me it is still unclear how I can achieve my goal. I don't understand how I should cast my stored reference. Small example for showing how I want to use it. #pragma once #include <systemc.h> #include <map> //typedef std::map<std::string, sc_interface*> Map0; //typedef std::map<std::string, sc_object*> Map0; typedef std::map<std::string, (????)*> Map0; // what type should I use since sc_out<T> varies on type T class stimulator: public sc_module { public: sc_out<bool> POWER_ON; sc_out<sc_uint<2>> T01_SBIT_mil_stub; private: Map0 dict; public: void stimulator::stimulus_generator() { std::string key0; for(int i=0; i<=1; i++) { if(i==0) key0 = "VOLTAGE"; else key0 = "T01_SBIT_mil_stub"; dict::iterator it0 = dict.find(key0); if (it0 == dict.end()) cout << "Map lookup key not found." << endl; // How to cast it? Type Erasure? if(i==0) it0->second->write(true); //write method not available else it0->second->write(1); //write method not available } } public: SC_CTOR(stimulator): POWER_ON("POWER_ON"), T01_SBIT_mil_stub("T01_SBIT_mil_stub") { // if type of map is sc_object* use get_parent() instead of get_interface() dict.insert( std::make_pair("VOLTAGE", POWER_ON.get_interface()) ); dict.insert( std::make_pair("T01_SBIT_mil_stub", T01_SBIT_mil_stub.get_interface()) ); SC_THREAD(stimulus_generator); // runs one time at creation, which is sufficient to demonstrate } } Is an sc_object* the best way to do it? If yes how do I cast it back to the right sc_out<T>? I know that I could solve my problem with a different approach, like defining enums and each enum indicates a port and thus I know which port I should write to. But that would involve more lines of code that is not really flexible. I prefer the generic way and would like to understand the SystemC framework better. Thanks for any help or guidance in advance 🙂
  2. Hi all, I created two modules with interfaces as below: M1 : sc_port<sc_fifo_out_if<T>, 0> a M2 : sc_port<sc_fifo_in_if<T>, 0> a2; I have a third module which is also my top module i.e M3 and tried binding M1 output to M2 input to create a communication channel. I have tried using sc_fifo<T> but it doesn't work. How do I bind M1 output to M2 input inside M3 module? Please not that T is a struct. Thanks
×
×
  • Create New...