Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with adding systemc.h in Riviera-PRO 2008.10

Status
Not open for further replies.

mr_byte31

Full Member level 5
Joined
Oct 19, 2005
Messages
295
Helped
10
Reputation
20
Reaction score
8
Trophy points
1,298
Activity points
3,241
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

#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
}
and here is the errors
# 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
any suggestions???
 

file include . .cpp systemc not declared

Have you tried using the absolut path in quotes,

i.e.
#include "C:\SomeDirectory\etc\systemc.h"
 

systemc.h: no such file or directory

the problem that i searched for systemc.h
in the program directory but i didn't find it
i searched for tutorials on the net for this program and i found it the same like what i did !!!!!!!!!!!!!
 

systemc.h no such file or directory

Before building a program that uses system-c library, you have to install system-c library and buil it with your compiler. Have you did it?
 

error: systemc.h: no such file or directory

no
but how can i do that????
 

sc_start was not declared in this scope

yes, you should first download and install the library!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top