...
error: no match for 'operator=' in 'u_adder.adder::p_in = 13'
where am i check in code which error : port not bound?
Hi.
If port not bound code error happened, where am i check in this code which error : port not bound?
so confused.
what is sc_initialize()?
As i know, sc_initialize() is just work for systemc scheduler initialize.
But i 'm not sure about what for use exactly?
Would you please let me know what (why/when) i have to use this?
How to pass modified Template argument to sub module?
I have a top level module with template like this:
template <int TOP_DEPTH=10> SC_MODULE(my_top){}
And I have several sub modules like this:
template <int DEPTH=10> SC_MODULE(sub_module_xxx>
I try to instantiate sub modules with the modified DEPTH from top level:
const int DEPTH_MODULE_A = <math1 on TOP_DEPTH> const int DEPTH_MODULE_B = <math2 on TOP_DEPTH> ... sub_module_a<DEPTH_MODULE_A> *pSubModuleA; sub_module_b<DEPTH_MODULE_B> *pSubModuleB; ...
I got compile error about "invalid use of non-static data member".
I am not sure what's the right way to do it in C++.
(I don't want DEPTH_MODULE_xxx to be static, because my top_module may be used as submodule in other project with different value of TOP_DEPTH. )
Practical Use of SystemC
I need to develop a SystemC model for a new (nonexisting) bus architecture, change it whenever needed and investigate its performance with every change. I do not know how to start on that, there is no tutorials or books that focus on using systemC in practical projects, all that's available is on the language itself. how do I approach this problem? how to start?
primitive channel vs hierachical channel
As i know, there are primitive channel and hierachical channel in systemC.
But i'm not sure about should i know both of things?
If you can, could you please let me know what thing is used for normally in company.
Also second question is that can be possible use sc_signal and sc_fifo and sc_buffer in one module?
If yes, what am i caution for using that in one module?
Thanks
should i make by class structure form for user define channel?
If no, where i reference that?
Multi-threading and SystemC
Hello everyone,
I was wondering if I could run in parallel a number of processes from different modules using multi-threading in SystemC. Take into account that these processes make use of SystemC elements like signal.read etc, from the SystemC library . That means SystemC library should be multi-threading safe. The reason why i want to use multi-threading is to decrease the simulation time, i.e. increase the performance of the simulation.
I found this link: http://www.accellera.org/activities/committees/systemc-language/
that states about recent activities on SystemC 2.3.0: " In addition, an improved simulation API and a new thread safety mechanism will allow much better interaction with external tools and support for multi-threading."
Does it mean, I can parallelize the execution of processes? and if yes how can I do it?
Thanks in advance
Nick
Is there any way how to make break point in cpp?
I want make break point into systemC OSCI code.
I already know about i can use break point in visual c++.
But i need that in linux.
Is there any way how to make break point in systemC osci code in linux?
Which one i use for verification both of systemC and UVM ?
I willing to start verification.
But i'm not sure which i have to use method whether systemC scv or UVM.
Does anyone advice about what am i use and start from systemc or uvm for verification?
..
Context switching
hello ,
I have a systemC model where i using two independent func ...these function have priority processing ..
so i case a higher priority requests comes context swtiching happens with resp to current processing ..
Any way to implement context switching w.r.t systemC
array of sc_vector : binding and assembling help
Hi,
So I have a submodule having an array of boolean input ports.
Now in the top module, I define an sc_vector of the submodule type. Also, I define an array of sc_vector signals to be bound to.
Questions:
Can I use an array of sc_vectors? Any conventions on using them?
eg: can I write
sc_vector < sc_signal <bool> > operand_vec[max_operands];
If no, then is there any work around for this?
Also, I now need to assemble and bind these ports:
The code below doesn't seem to work.
Both the stack_cnt_vec and operand_vec are initialized properly.
for(int i=0;i<max_operands;i++){ operand_vec[i].init(10); }
for(int i=0; i<10; i++) { sc_assemble_vector( stack_cnt_vec, &StackController::operands[i]).bind( operand_vec[i] ); }
Thanks a lot for your time.
creation of dll of systemc
I want to create a .dll during the build of systemc through visual studio 2010 but it reports an error
end_of_simulation is not triggered
Hi All:
I got a given SystemC code running without end_of_simulation called. And I know "end_of_simulation" won't be called if sc_stop is not called.
I debug into the code and see following situation. Code looks like
void thread_a() //it is a sc thread
{
while(xxx) {
wait(sc_time(x,SC_NS)); break 1
cout<<"xxxxx"<<endl; break 2
---logics----
}
sc_stop;
}
The last time I was stopped at breakpoint 1, then I did step next. Then instead of stopping at breakpoint 2 , I stopped at sc_main after sc_start.
So it looks like the entire thread is stopped by others? What else than "sc_stop" can terminate the thread? Since my code in "end_of_simulation" is not triggered, I am sure that there is no other sc_stop in my programme that calling sc_stop. So what can be the backend hand doing that?
Thanks a lot for all your help
sc_cor_qt::stack_protect
Hello all,
I've recently created a vary large model and I have encounted an assertion violation in sc_cor_qt::stack_protect. The mprotect system call returns a -1 value, triggering the assertion. The errno is ENOMEM. There is no memory allcoated expilicitly in stack_protect so it must mean that the address passed to mprotect is invalid.
If I remove the stack_protect call from sc_thread_process::prepare_for_simulation then my model runs just fine. So it appears that stack_protect is not strictly needed, but probably a good idea to leave it in if you can.
Anyone else ever have any problems with the stack_protect call?
Thanks,
Terry
SystemC basics
Hi,
I am currently migrating from C++ to system C. I have nested functions in C++ and i need to replicate same behaviour in system C. how can i do that. Below is the mimic of the behavior of the model which i want to achieve.
void check(int a, int b )
{ int x=10;
int y=20;
add_m(a,x);
sub_m(b,y);
}
void add_m(int a, int x)
{
cout<<a+x<<endl;
}
void sub_m(int b,int y)
{
cout<<b-y<<endl;
}
till know what i did is :-
sc_module(check) {
sc_ctor(check){
sc_thread(run);
}
};
void check::run(int a, int b )
{ int x=10;
int y=20;
add_m(a,x);
sub_m(b,y);
}
int sc_main(int argc,char*argv[]){
check chk("chk");
}
Now how to declare add_m and sub_m. Can anybody help me out???
Segfault when sc_vector deallocates memory
I am trying to use an sc_vector of modules with a custom creator to pass constructor arguments. It seems to work and run through the entire program, but at exit causes a segfault. GDB shows that this is due to to sc_vector calling the destructor of the module.
I have no dynamically-allocated memory or pointers in the module. Here's the overview:
outside of sc_main (global -- but I also tried inside of sc_main):
--------------------------
struct create_mod { unsigned int m_arg1; unsigned int m_arg2; create_mod(unsigned int arg1, unsigned int arg2) : m_arg1(arg1), m_arg2(arg2) {} mod* operator()(const char* name, size_t) { return new mod(name, m_arg1, m_arg2); } };
Inside sc_main:
---------------------------
unsigned int num_of_mods = 8; unsigned int args1 = 5, args2 = 4; sc_vector<mod> vec_mod("mods"); vec_mod.init(num_of_mods, create_mod(args1, args2)); // ... use vec_mod, bind ports, etc ... return 0;
So the program runs, then segfaults at the end with "core dumped". GDB results:
Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x5006e4b8e) at malloc.c:2929
2929 malloc.c: No such file or directory.
Backtracing shows:
#0 __GI___libc_free (mem=0x5006e4b8e) at malloc.c:2929
#1 0x00007ffff77e017b in sc_core::sc_module::~sc_module() ()
from /usr/local/systemc/lib-linux64/libsystemc-2.3.1.so
#2 0x000000000042e6a0 in mod::~mod (this=0x6bf650) at ../src/mod.h:25
#3 0x000000000042e6c9 in mod::~mod (this=0x6bf650) at ../src/mod.h:25
#4 0x000000000044593b in sc_core::sc_vector<mod>::clear (this=0x7fffffffc748)
at /usr/local/systemc/include/sysc/utils/sc_vector.h:653
#5 0x0000000000442e6f in sc_core::sc_vector<mod>::~sc_vector (
this=0x7fffffffc748)
at /usr/local/systemc/include/sysc/utils/sc_vector.h:696
#6 0x0000000000441fb4 in sc_main (sc_argc=1, sc_argv=0x6a8400)
at ../src/main.cpp:334
#7 0x00007ffff77dd674 in sc_elab_and_sim ()
from /usr/local/systemc/lib-linux64/libsystemc-2.3.1.so
#8 0x00007ffff6e9fec5 in __libc_start_main (main=0x404b00 <main@plt>, argc=1,
argv=0x7fffffffdf48, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_end=0x7fffffffdf38) at libc-start.c:287
#9 0x0000000000406a5c in _start ()
Note the bit in red. Also note that line 334 is the closing brace of sc_main.
Also:
(gdb) frame 2
#2 0x000000000042e6a0 in mod::~mod (this=0x6bf650) at ../src/mod.h:25
25 class mod : public sc_module
(gdb) frame 3
#3 0x000000000042e6c9 in mod::~mod (this=0x6bf650) at ../src/mod.h:25
25 class mod : public sc_module
As I said, I have no dynamically-allocated memory in the class. I have tried an empty destructor (as well as = default since I'm using C++11) but got the same result.
Any ideas?
Thanks in advance.
Could I initialize sc_vector when I defining it?
error: ‘process’ is not a member of ‘host_cntrl::SC_CURRENT_USER_MODULE’
hello all ,
Getting this error while compiling my system C moduole ...
Could anyone explain me what this is ??