URL
https://opencores.org/ocsvn/sc2v/sc2v/trunk
[/] [sc2v/] [trunk/] [examples/] [dummy2.h] - Diff between revs 33 and 36
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 33 |
Rev 36 |
/*
|
/*
|
This is a example code that does nothing but uses the new
|
This is a example code that does nothing but uses the new
|
features included in new versions
|
features included in new versions
|
*/
|
*/
|
|
|
|
|
#include "systemc.h"
|
#include "systemc.h"
|
|
|
SC_MODULE(fsm){
|
SC_MODULE(fsm){
|
|
|
sc_in<bool> clk;
|
sc_in<bool> clk;
|
sc_in<bool> rst,
|
sc_in<bool> rst,
|
sc_in<bool> input1, input2;
|
sc_in<bool> input1, input2;
|
sc_out<sc_uint<2> > a,b,w;
|
sc_out<sc_uint<2> > a,b,w;
|
|
|
void regs();
|
void regs();
|
void fsm_proc();
|
void fsm_proc();
|
void dummy_proc();
|
void dummy_proc();
|
|
|
sc_signal<sc_uint<2> > state,next_state;
|
sc_signal<sc_uint<2> > state,next_state;
|
sc_signal< sc_uint<32> > array[12];
|
sc_signal< sc_uint<32> > array[12];
|
|
|
SC_CTOR(fsm){
|
SC_CTOR(fsm){
|
|
|
SC_METHOD(regs);
|
SC_METHOD(regs);
|
sensitive_pos(clk);
|
sensitive_pos(clk);
|
sensitive_neg(rst);
|
sensitive_neg(rst);
|
|
|
SC_METHOD(fsm_proc);
|
SC_METHOD(fsm_proc);
|
sensitive(state);
|
sensitive(state);
|
sensitive << input1;
|
sensitive << input1;
|
sensitive(input2);
|
sensitive(input2);
|
|
|
SC_METHOD(dummy_proc);
|
SC_METHOD(dummy_proc);
|
sensitive << input1;
|
sensitive << input1;
|
|
|
}
|
}
|
};
|
};
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.