OpenCores
URL https://opencores.org/ocsvn/sc2v/sc2v/trunk

Subversion Repositories sc2v

[/] [sc2v/] [trunk/] [examples/] [dummy1.h] - Blame information for rev 36

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 21 jcastillo
/*
2
This is a example code that does nothing but uses the new
3
features included in new versions
4
*/
5
 
6
 
7
#include "systemc.h"
8
 
9 22 jcastillo
SC_MODULE(dummy1){
10 21 jcastillo
 
11
   sc_in<bool> clk;
12 22 jcastillo
   sc_in<bool> rst;
13
   sc_in<sc_uint<2> > input1, input2;
14 21 jcastillo
   sc_out< sc_uint<2> > a,b,w;
15
 
16 22 jcastillo
   enum state_t {A,B};
17 21 jcastillo
   sc_signal<state_t> state,next_state;
18
 
19 22 jcastillo
   enum {S0,S1,S2,S3,EE} estado;
20 21 jcastillo
   enum {AAA} est;
21
 
22
 
23
   sc_signal<sc_uint<4> > temp;
24 22 jcastillo
   sc_signal<sc_uint<2>> b_a;
25 21 jcastillo
 
26
   void regs();
27
   void fsm_proc();
28
   sc_uint<2> func1 (sc_uint<2> a, sc_uint<2> b);
29
 
30
   moduleA *moda;
31 22 jcastillo
   moduleA *modb;
32 21 jcastillo
 
33 22 jcastillo
   SC_CTOR(dummy1){
34 21 jcastillo
 
35
     moda = new moduleA("MODA");
36
 
37 22 jcastillo
     moda->m1_in(b_a);
38 21 jcastillo
     moda->m1_out(w);
39 22 jcastillo
 
40
     modb = new moduleA("MODB");
41
 
42
     modb->m1_in(input2);
43
     modb->m1_out(b_a);
44 21 jcastillo
 
45 22 jcastillo
 
46 21 jcastillo
     SC_METHOD(regs);
47
     sensitive_pos(clk);
48
     sensitive_neg(rst);
49
 
50
     SC_METHOD(fsm_proc);
51
     sensitive(state);
52
     sensitive << input1;
53
     sensitive(input2);
54
 
55
 }
56
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.