mr_byte31
Full Member level 5
hi every body
i have Riviera-PRO 2008.10 and i want to use it to write systemC programs
i had a problem
1- i can't add systemc.h to my design i tried
#include "systemc.h"
#include <systemc.h>
both of them doesn't work
here is my code
i have Riviera-PRO 2008.10 and i want to use it to write systemC programs
i had a problem
1- i can't add systemc.h to my design i tried
#include "systemc.h"
#include <systemc.h>
both of them doesn't work
here is my code
and here is the errors#include "systemc.h"
SC_MODULE(driver)
{
sc_out<sc_bit> d_a;
sc_out<sc_bit> d_b; //inputs to the OR gate are of type sc_bit
void drivea()
{
d_a.write((sc_bit)false);//(ba)=00
wait(5,SC_NS);
d_a.write((sc_bit)true);//(ba)=01
wait(5, SC_NS);
d_a.write((sc_bit)0);//(ba)=10, false=0
wait(5,SC_NS);
d_a.write((sc_bit)1);//(ba)=11, true=1
wait(5,SC_NS);
}
void driveb()// these are two processes to stimulate the OR gate
{
d_b.write((sc_bit)0);
wait(10,SC_NS);
d_b.write((sc_bit)1);
wait(5,SC_NS);
}
SC_CTOR(driver)
{
SC_THREAD (drivea);
SC_THREAD (driveb);//processes are called here
}
};
SC_MODULE(monitor)
{
sc_in<sc_bit> m_a, m_b;
sc_in<sc_bit> m_c;//both input and output of the OR module are to
//be monitored
void prc_monitor()
{
cout <<" At "<<sc_simulation_time()<<" input is : ";
cout <<m_a<<" , "<<m_b<<" output is : "<<m_c<<endl;
}
SC_CTOR(monitor)
{
SC_METHOD(prc_monitor);
sensitive << m_a <<m_b <<m_c;
//whenever the i/p to the gate changes,
//or the o/p changes, the process prc_monitor triggers
}
};
int sc_main(int argc , char *argv[] )
{
sc_signal <sc_bit> t_a, t_b, t_c;
//signals t_a, t_b, t_c are used to connec all the modules
or_gate g1("orgate");
driver d1("driver");
monitor m1("monitor");
g1.a(t_a); g1.b(t_b); g1.c(t_c);
//the above is called named binding
d1<<t_a<<t_b;
m1<<t_a<<t_b<<t_c; //these are called positional binding
sc_start(100,SC_NS);//start the simulation and run for 100 ns
return 0;//return success
}
any suggestions???# Used command line: ccomp -pli -o {C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/output} -I {C:/Program Files/Aldec/Riviera-PRO-2008.10/mingw/include} -L {C:/Program Files/Aldec/Riviera-PRO-2008.10/mingw/lib} {C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp}
# Compile...
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:1:21: systemc.h: No such file or directory
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:3: error: expected constructor, destructor, or type conversion before '(' token
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:34: error: expected constructor, destructor, or type conversion before '(' token
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp: In function `int sc_main(int, char**)':
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:57: error: `sc_signal' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:57: error: `sc_bit' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:57: error: `t_a' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:57: error: `t_b' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:57: error: `t_c' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:60: error: `or_gate' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:60: error: expected `;' before "g1"
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:61: error: `driver' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:61: error: expected `;' before "d1"
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:62: error: `monitor' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:62: error: expected `;' before "m1"
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:64: error: `g1' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:67: error: `d1' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:68: error: `m1' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:70: error: `SC_NS' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:70: error: `sc_start' was not declared in this scope
# CCOMP: C:/Program Files/Aldec/Riviera-PRO-2008.10/bin/driverK.cpp:73:2: warning: no newline at end of file
# CCOMP: Compilation failed.
# ...failed