Jump to content

OMark

Members
  • Content Count

    8
  • Joined

  • Last visited

About OMark

  • Rank
    Member

Profile Information

  • Location
    Stuttgart, Germany
  1. @David Black As proposed, here is an illustration of what I try to achieve. In the original design, I have SystemC modules "A" and "C" connected directly, where the sc_port of the module "C" uses the Interface provided by sc_export of module "A". Now, I added a module "B" which is supposed to route flexibly the signals and forward their values to destination. I succeeded to achieve the binding between modules "A", "B" and "C" as illustrated in the picture. But I am not sure how to forward efficiently the values from the sc_port of the "B" module to the sc_export of that same module to be consu
  2. Hello, I have a systemC module having an input sc_in<bool> and an output sc_export<sc_core::sc_signal_inout_if<bool>>. How can I route the signal values coming on the input systemc port to the export port? Is that even doable and under which conditions? Thanks.
  3. Hello, I tried out your method as follows: sc_object* test_object_find = sc_core::sc_find_object(port_name); sc_core::sc_object& obj = dynamic_cast <sc_core::sc_object&>(*test_object_find); PortElement<sc_logic>* PE = new PortElement<sc_logic>(count,hierarchical_name,port_name,obj); sc_core::sc_attribute<PortElement<sc_logic>*> attr{"PortElement", nullptr}; attr.value = PE; Until here, I am capable to build and run without issue. Then when I follow up the above lines of code with this one: obj.add_attribute(attr);
  4. Hello, I have defined one class "Class A" and when creating instances of that class e.g. A* instA1 = new A (); I want to attach the instA1 object to an sc_in port of my SystemC module as an attribute of that port. - Can I use for that purpose the add_attribute function? - How safe is that? - Are there any other recommended mechanisms (as alternatives)? Thanks.
  5. Hello, Thanks @Eyck for your prompt response. I corrected the code example as below and the binding works fine now. #include "stdafx.h" #include "systemc.h" struct test_producer : sc_module{ sc_out<sc_dt::sc_logic> out1; sc_out<sc_dt::sc_logic> out2; SC_HAS_PROCESS(test_producer); test_producer(::sc_core::sc_module_name){ SC_THREAD(test_prod); } void test_prod(){ while (1){ out1.write(SC_LOGIC_0); out2.write(SC_LOGIC_0); wait(10, SC_NS); out1.write(S
  6. Hello, I have an example of an initiator with large number of sc_out type of ports (let us say around 400). I need to model a target which should be bound to the different output signals of the initiator and handles their written values internally. To have a more generic and minimal code of such a target I thought that the best way is to have a multiport of type sc_port<sc_signal_inout_if<T>,N>, with number N is the number of outputs that the target should receive. I tried the following code with N=2 as a probe: struct test_producer : sc_module{ sc_out<s
  7. Hi David, Thanks first for your prompt and detailed response. Unfortunately I am using the SystemC 2.3.1. What is the best solution to capture the triggered event on the multiport and related port index in this case?
  8. Hello, When using a multiport port type as follows: struct M:sc_module{ sc_port<sc_signal_in_if<sc_dt::sc_logic>, 32, SC_ZERO_OR_MORE_BOUND> prt_input; void end_of_eleaboration(){ SC_METHOD(action); for(int i=0;i<prt_input.size();i++) sensitive << prt_input->value_changed_event(); } ... }; Is there any way to capture the port index "i" which changed the value and caused the method to be called? Thanks,
×
×
  • Create New...