text
stringlengths
0
252
* @ASCK
*/
#include <systemc.h>
SC_MODULE (Mux3) {
sc_in <bool> sel;
sc_in <sc_uint<3>> in0;
sc_in <sc_uint<3>> in1;
sc_out <sc_uint<3>> out;
/*
** module global variables
*/
SC_CTOR (Mux3){
SC_METHOD (process);
sensitive << in0 << in1 << sel;
}
void process () {
if(!sel.read()){
out.write(in0.read());
}
else{
out.write(in1.read());
}
}
};
/*
* @ASCK
*/
#include <systemc.h>
SC_MODULE (Mux8) {
sc_in <bool> sel;
sc_in <sc_int<8>> in0;
sc_in <sc_int<8>> in1;
sc_out <sc_int<8>> out;
/*
** module global variables
*/
SC_CTOR (Mux8){
SC_METHOD (process);
sensitive << in0 << in1 << sel;
}
void process () {
if(!sel.read()){
out.write(in0.read());
}
else{
out.write(in1.read());
}
}
};
/*
* @ASCK
*/
#include <systemc.h>
SC_MODULE (PC) {
sc_in <bool> clk;
sc_in <sc_uint<14>> prev_addr;
sc_out <sc_uint<14>> next_addr;
/*
** module global variables
*/
SC_CTOR (PC){
SC_METHOD (process);
sensitive << clk.pos();
}
void process () {
next_addr.write(prev_addr.read());
}
};
/*
* @ASCK
*/