Jump to content

Eustaquio

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Many thanks for the proposed solution (that worked) and for the clear explanation.
  2. I am working as a VHDL developer, and I am evaluating the use of SystemC, mainly focused on writing synthesizable code according some third vendor manuals. I am currently writing SystemC versions of some basic VHDL modules we have, and I have some newbie doubts accesing a range of bits of types sc_lv<n>. For example, I have this code that works: SC_MODULE (blah) { .... sc_out <sc_lv<8> > dummy; ... dummy.write((SC_LOGIC_0, dummy.read()(7,1))); // Correct at compile and simulation ... But I am not able to write to a single position or to a range of positions of dummy. Following instructions of different manuals, and trying desperate things, I have tried: dummy[2].write(SC_LOGIC_1); // error: request for member ‘write’ in [...] (maybe you meant to use ‘->’ ?) dummy[2]=SC_LOGIC_1; // error : lvalue required as left operand of assignment dummy(5,2).write(0xA); // error: no match for call to ‘(sc_core::sc_out<sc_dt::sc_lv<8> >) (int, int)’ dummy.range(5,2).write(0xA); // error: ‘class sc_core::sc_out<sc_dt::sc_lv<8> >’ has no member named ‘range’ How could I write on position 2 of dummy, or a nibble in positions 5 to 2 of dummy? The only working solution I have found is too complicated, so I think it is an awful way: dummy.write(((dummy.read()(7,3), SC_LOGIC_1),dummy.read()(1,0))); // Working, but too complicated dummy.write(((dummy.read()(7,6), 0xA),dummy.read()(1,0))); // Working, but too complicated
×
×
  • Create New...