systemc-clang icon indicating copy to clipboard operation
systemc-clang copied to clipboard

Const member construction misses argument

Open zhuanhao-wu opened this issue 3 years ago • 0 comments

https://github.com/intel/systemc-compiler/blob/main/tests/method/test_const_static_mem.cpp#L94


// Constant static members, constant records
struct Simple {
    bool a;
    sc_uint<4> b;

    Simple(bool a, sc_uint<4> b) : a(a), b(b) 
    {}
};

// Constant record member and local
const Simple mrec1{false, 4};
const Simple mrec2{false, 5};

Currently we are generating the following code. Notice that we are missing the false in the hVarInit.

hVardecl mrec1_scclang_global_2 [
  hTypeinfo  NONAME [
    hType Simple_ NOLIST
  ]
  hVarInit  NONAME [
    hLiteral 4 [
      hTypeinfo  NONAME [
        hType sc_uint [
          hLiteral 4 NOLIST
        ]
      ]
    ]
  ]
]

zhuanhao-wu avatar Aug 22 '22 17:08 zhuanhao-wu