Jump to content


  • Content Count

  • Joined

  • Last visited

About JorgeAbarca

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, i am creating a new port for a specific purpose, it works very well with the most of datatypes, but i got an error trying to support sc_logic. in this example the behavior is if my_event is detected a write is forced. but if it is an sc_logic I forced sc_logic_z but if it is other datatype I force 0. my intention is to detect if the object is sc_logic or not using typeid(T).name(), what in my operative system is "N5sc_dt8sc_logicE" , but i am getting this error: In file included from ./main.cpp:42:0: ./port_new.h: In instantiation of ‘void sc_out_new<T>::write(T) [with T = double]’: ./stage1.cpp:67:15: required from here ./port_upf.h:194:8: error: no match for ‘operator=’ (operand types are ‘sc_core::sc_out<double>’ and ‘const sc_dt::sc_logic’) out=SC_LOGIC_Z; any idea about how i can write both types using the same class ??? my module: struct numgen : sc_module { sc_out_new<double> out1; //output 1 sc_out_new<sc_logic> out2; ... } my class: Template<typename T> class sc_out_new : public sc_channel { ... SC_HAS_PROCESS(sc_out_new); sc_in_upf(const sc_module_name& nmod) : sc_channel(nmod){ SC_METHOD(write_out); sensitive << my_event } void write_out{ if(typeid(T).name() == "N5sc_dt8sc_logicE"){ out.write(SC_LOGIC_Z); }else{ out.write(0); } } } thanks for the help
  2. JorgeAbarca

    primitive port that responds to sensitivity ???

    let me explain better, what I need is to represent power domains in SystemC for functional verification, reading the UPF file. The idea is to make the implementation hidden for the user, then it would be automatic and transparent for the user. That said, i thought that i could modify the sc_out class using inheritance, to be aware about the domain to which belongs, but then i need to turn off the signal if the domain is off. to do that, i thought that i would need to create a sc_out with sensitivity, then it automatically could monitor the status of the domain, and if the status in OFF, it automatically could be set to 0. I'd say that it is possible, but i'd like to know the opinion of expert people like you. what parts would I have to modify? thanks!
  3. Hi! I am new on this, and i am learning systemC. i am working on an academic project, then i wonder if it is possible (after some systemC code modifications) to generate primitive_ports that respond to a sensitivity list? then I could generate a function that set to 0 each port when a global signal is set to a specific state. is it possible? what parts of systemC code i'd need to modify? thanks a lot in advance for the help and guidance!