Friday, 10 August 2012

New? school systemc system-c sensitive << clk.pos() clock.pos()


Ubuntu 10.04 (CAD VP) 11.01

    switches(sc_module_name name)
    :sc_module(name)
    {
        SC_THREAD(run);
        sensitive << clk.pos();
    }


switches.h: In constructor 'switches::switches(sc_core::sc_module_name)':
switches.h:56: error: 'class sc_core::sc_clock' has no member named 'pos'



    switches(sc_module_name name)
    :sc_module(name)
    {
        SC_THREAD(run);
        sensitive_pos << clk;
    }


Thursday, 9 August 2012

undefined reference to `outbyte'


undefined reference to `outbyte'

his error occurs when the C-code contains "printf-" statements and a peripheral has not been defined as "std_out" and "std_in". To work around this problem, use one of the following solutions:

Remove the "printf-" statement.
or
Define peripheral as Standard-out and Standard-in.

This can be done by using the Software Platform Settings dialog box.

Wednesday, 8 August 2012

Compile SystemC in modelsim


Version 6.2 a or later supports System C

Download GCC from ModelSim ftp site (registration is required)

For 6.2g modelsim-gcc-3.3.1-mingw32.zip

Extract and copy the gcc folder to the ModelSim install directory

To compile, do not use the “standard “ ModelSim compile buttons.

From the command line: sccom –work systemc *.cpp
Sccom –work systemc -link

Error: suffix or operands invalid for `push' Error: suffix or operands invalid for `pop'


When trying to compile a 32 bit app on 64 bit system 
/tmp/ccYmzX7h.s: Assembler messages:
/tmp/ccYmzX7h.s:20: Error: suffix or operands invalid for `push'
/tmp/ccYmzX7h.s:28: Error: suffix or operands invalid for `pop'

This is the Assembler, not the compiler misinterpreting the 32bit instructions

Use gcc option –Wa,--32 to tell assembler to use 32bit