Last active
September 2, 2022 18:46
-
-
Save rahulbhadani/97011f51dbb2a720a4688cb0e157d19a to your computer and use it in GitHub Desktop.
Reader Writer Simulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "reader_writer.h" | |
int sc_main(int argc, char **argv) | |
{ | |
/*Declare/define primitive channel -- sc_signal*/ | |
sc_signal<unsigned int> SIG; | |
/*Declare a master -- period 10 ns, duty cycle 50%*/ | |
sc_clock CLK("clock", 10.0, SC_NS, 0.5); | |
Write W("WRITER"); | |
Read R("READER"); | |
W.clk(CLK); | |
W.out(SIG); | |
R.clk(CLK); | |
R.in(SIG); | |
/*Run simulation for predefined time interval and stop */ | |
sc_start(500.0, SC_NS); | |
sc_stop(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment