29 lines
662 B
Plaintext
29 lines
662 B
Plaintext
#include "systemc.h"
|
|
|
|
<beginfold id='1'>/*</beginfold id='1'>
|
|
multi line comment
|
|
<endfold id='1'>*/</endfold id='1'>
|
|
|
|
// declare some module
|
|
SC_MODULE(gate)
|
|
<beginfold id='2'>{</beginfold id='2'>
|
|
// inputs
|
|
sc_in<bool> inA, inB;
|
|
|
|
// outputs
|
|
sc_out<bool> out;
|
|
|
|
// C function
|
|
void do_something()
|
|
<beginfold id='2'>{</beginfold id='2'>
|
|
out.write(inA.read() || inB.read());
|
|
<endfold id='2'>}</endfold id='2'>
|
|
|
|
// constructor
|
|
SC_CTOR(gate)
|
|
<beginfold id='2'>{</beginfold id='2'>
|
|
// register method
|
|
SC_METHOD(do_something);
|
|
<endfold id='2'>}</endfold id='2'>
|
|
<endfold id='2'>}</endfold id='2'>;
|