dpk
dpk

Reputation: 1

SystemC ERROR: type name requires a specifier or qualifier

I am trying to write synthesizable SystemC code.

My code:

struct test:sc_module{
    sc_in<sc_lv<4>> inp;
    sc_out<sc_lv<4>> outp;

    void run(){
        sc_lv<4> temp = inp.read();
        outp.write(temp);
    }

    SC_CTOR(test){
        SC_METHOD(run);
        sensitive << inp;
    }
};

I am able to simulate the code, but when I run synthesis, Vivado HLS v.2019 throws the following errors. Can someone please help me understand how to fix this error?

ERROR: [HLS 200-70] Compilation errors found: In file included from test2/test.cpp:1:
test2/test.cpp:4:18: error: use of undeclared identifier 'inp'
 sc_in<sc_lv<4>> inp;
                 ^
test2/test.cpp:4:21: error: type name requires a specifier or qualifier
 sc_in<sc_lv<4>> inp;
                    ^
test2/test.cpp:4:21: warning: declaration does not declare anything [-Wmissing-declarations]
 sc_in<sc_lv<4>> inp;

Upvotes: 0

Views: 70

Answers (1)

dpk
dpk

Reputation: 1

When I add spaces between the angular brackets (as below), it does not throw an error, and synthesis runs successfully.

sc_in< sc_lv<4> > inp;
sc_out< sc_lv<4> > outp;

Upvotes: 0

Related Questions