Meir Posted March 11, 2020 Report Posted March 11, 2020 hey all. lets say i have the following SC_THREADS, with the sensitivity of rising clock edge. thread 1: takes a variable 'cur_address' and uses it to access a memory. thread 2: updates the value of 'cur_address' depending on a given logic. since i cant tell the order of which the threads execute, is it possible that thread 1 will be invoked twice (for example) before the 'cur_address' variable updates ? thank you in advance, Meir Quote
Eyck Posted March 11, 2020 Report Posted March 11, 2020 Each thread will invoked once since they are sensitive to clock. If you use here plain C++ types you will run into issues as you mentioned since it is not specified in which order the threads are activated. Therefor you need to use a signal to cummunicate between the threads: if you write to a signal you will still read the old value until the update phase is executed. This is followed by the next eavaluate phase in the next delta cycle or timestep. This way it doesn't matter in which order the threads are invoked. You should (re-)read some books or check with some online tutorials about SystemC as this mechanism builds the foundation of the simulation semantics, Quote
Meir Posted March 11, 2020 Author Report Posted March 11, 2020 thank you very much. needless to say i did some readings, but i am guessing not with the appropriate sources. Quote
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.