omaima Posted September 21, 2020 Report Share Posted September 21, 2020 Hi everyone I'm new in systemc ,I'm trying to design (and gate) and create vcd file for simulation and when build project I got on these error ??:??:?? **** Incremental Build of configuration Debug for project and_get **** make all Building file: ../and_test.cpp Invoking: Cygwin C++ Compiler g++ -I"C:\Users\ALTQNIA\Desktop\systemc-2.3.3\systemc-2.3.3\include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"and_test.d" -MT"and_test.o" -o "and_test.o" "../and_test.cpp" ../and_test.cpp:2:9: fatal error: andh2.h: No such file or directory 2 | #include<andh2.h> | ^~~~~~~~~ compilation terminated. make: *** [subdir.mk:20: and_test.o] Error 1 "make all" terminated with exit code 2. Build might be incomplete. ??:??:?? Build Failed. 2 errors, 0 warnings. (took 10s.595ms) these is my code /////////////////////////////////////////////////////////////////////////////// andh2.h #include"systemc.h" SC_MODULE(andh2){ sc_in<bool> a; sc_in<bool> b; sc_out<bool> o; void and_process(){ o.write(a.read()&&b.read()); } SC_CTOR(andh2){ SC_METHOD(and_process); sensitive<<a<<b; } }; ////////////////////////////////////////////////////////////// and_test/cpp #include<systemc.h> #include<andh2.h> void sc_main(int argc, char* argv[]) { andh2 and1("and1"),and2("and2"),and3("and3"); sc_signal<bool> A,B,O; and1.a(A); and2.b(B); and1.o(O); sc_start(SC_ZERO_TIME); sc_trace_file *tf=sc_create_vcd_trace_file("trace"); tf->set_time_unit(1,SC_NS); sc_trace(tf,A,"A");sc_trace(tf,B,"B"); sc_trace(tf,O,"O"); A=0;B=0; sc_start(10,SC_NS); for(int i=0;i<10;i++){ A=((i& 0*1)!=0); B=((i& 0*2)!=0); sc_start(10,SC_NS); } sc_close_vcd_trace_file(tf); sc_start(); } Quote Link to comment Share on other sites More sharing options...
Eyck Posted September 21, 2020 Report Share Posted September 21, 2020 If you use #include with angle brackets the current directory is not part of the include search path. So either you use #include "andh2.h" or add the current directory to the list of include directories of the compiler invocation Quote Link to comment Share on other sites More sharing options...
omaima Posted September 21, 2020 Author Report Share Posted September 21, 2020 Thanks it worked build succeeded ,but When I run the program I get this message Quote Link to comment Share on other sites More sharing options...
Eyck Posted September 25, 2020 Report Share Posted September 25, 2020 Actually your code is a bit buggy and has some misconceptions. For your convenience I code up your example at https://www.edaplayground.com/x/CfVM Maybe you should read some books (e.g. @David Blacks 'SystemC from the ground up') or checkout some tutorials using a search engine of your choice. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.