Jump to content

Maxim Vorontsov

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. Yes, that's exactly how I'm workarounding it now. Would you please narrow me, where this derived from SCV documentation, to I might look for the limitations in the future? Because I've been looking into scv headers and that was not really clear. Thanks
  2. Thanks basarts, I indeed got rid of compilation error, but there is simulation runtime error: tb.cpp: #include "systemc.h" #include "scv.h" // // struct aaa { sc_uint<32> addr; }; // struct addr_rnd : public scv_constraint_base { scv_smart_ptr<sc_uint<32>> addr; SCV_CONSTRAINT_CTOR(addr_rnd) { SCV_CONSTRAINT( addr->range(1,0) == 0 ); } }; // int sc_main(int argc, char * argv[]) { // // addr_rnd addr("addr"); addr.next(); // // return 0; } $ g++ -lsystemc -lscv -std=gnu++17 tb.cpp $ ./a.out SystemC 2.3.3-Accellera --- Dec 20 2018 16:31:31 Copyright (c) 1996-2018 by all Contributors, ALL RIGHTS RESERVED Error: CONSTRAINT_ERROR_OVER_CONSTRAINED: Constraints for over-constrained object 'addr' will be ignored. In file: unknown:0
  3. Dear accellera community, I'm trying to assign randomization constraint to a bit range: tb.cpp: #include "systemc.h" #include "scv.h" // // struct addr_rnd : public scv_constraint_base { scv_smart_ptr<sc_uint<32>> addr; SCV_CONSTRAINT_CTOR(addr_rnd) { SCV_CONSTRAINT( addr().range(1,0) == 0 ); } }; // int sc_main(int argc, char * argv[]) { // // addr_rnd addr("addr"); addr.next(); // // return 0; } g++ -lsystemc -lscv -std=gnu++17 tb.cpp And I get the following error: In file included from /home/mvorontsov/include/scv.h:50:0, from tb.cpp:2: tb.cpp: In member function 'void addr_rnd::init_core()': tb.cpp:8:26: error: 'class scv_expression' has no member named 'range' SCV_CONSTRAINT( addr().range(1,0) == 0 ); ^ /home/mvorontsov/include/scv/scv_constraint.h:821:38: note: in definition of macro 'SCV_CONSTRAINT' #define SCV_CONSTRAINT(expr) eh() &= expr; Would you please advise me what i am doing wrong?
×
×
  • Create New...