1 | #ifdef SYSTEMC |
---|
2 | /* |
---|
3 | * $Id$ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Generic/RegisterFile/include/RegisterFile.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace generic { |
---|
14 | namespace registerfile { |
---|
15 | |
---|
16 | void RegisterFile::allocation (void) |
---|
17 | { |
---|
18 | in_CLOCK = new SC_CLOCK ("in_CLOCK"); |
---|
19 | in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET"); |
---|
20 | |
---|
21 | // ----- Interface Read |
---|
22 | in_READ_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_read]; |
---|
23 | out_READ_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_read]; |
---|
24 | in_READ_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_port_read]; |
---|
25 | out_READ_DATA = new SC_OUT(Tdata_t ) * [_param._nb_port_read]; |
---|
26 | |
---|
27 | for (uint32_t i=0; i<_param._nb_port_read; i++) |
---|
28 | { |
---|
29 | string rename; |
---|
30 | |
---|
31 | rename = "in_READ_VAL[" + toString(i) + "]"; |
---|
32 | in_READ_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
33 | |
---|
34 | rename = "out_READ_ACK[" + toString(i) + "]"; |
---|
35 | out_READ_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
36 | |
---|
37 | rename = "in_READ_ADDRESS[" + toString(i) + "]"; |
---|
38 | in_READ_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
39 | |
---|
40 | rename = "out_READ_DATA[" + toString(i) + "]"; |
---|
41 | out_READ_DATA [i] = new SC_OUT(Tdata_t) (rename.c_str()); |
---|
42 | } |
---|
43 | |
---|
44 | // ----- Interface Write |
---|
45 | in_WRITE_VAL = new SC_IN (Tcontrol_t) * [_param._nb_port_write]; |
---|
46 | out_WRITE_ACK = new SC_OUT(Tcontrol_t) * [_param._nb_port_write]; |
---|
47 | in_WRITE_ADDRESS = new SC_IN (Taddress_t) * [_param._nb_port_write]; |
---|
48 | in_WRITE_DATA = new SC_IN (Tdata_t ) * [_param._nb_port_write]; |
---|
49 | |
---|
50 | for (uint32_t i=0; i<_param._nb_port_write; i++) |
---|
51 | { |
---|
52 | string rename; |
---|
53 | |
---|
54 | rename = "in_WRITE_VAL[" + toString(i) + "]"; |
---|
55 | in_WRITE_VAL [i] = new SC_IN (Tcontrol_t) (rename.c_str()); |
---|
56 | |
---|
57 | rename = "out_WRITE_VAL[" + toString(i) + "]"; |
---|
58 | out_WRITE_ACK [i] = new SC_OUT(Tcontrol_t) (rename.c_str()); |
---|
59 | |
---|
60 | rename = "in_WRITE_ADDRESS[" + toString(i) + "]"; |
---|
61 | in_WRITE_ADDRESS [i] = new SC_IN (Taddress_t) (rename.c_str()); |
---|
62 | |
---|
63 | rename = "in_WRITE_DATA[" + toString(i) + "]"; |
---|
64 | in_WRITE_DATA [i] = new SC_IN (Tdata_t) (rename.c_str()); |
---|
65 | } |
---|
66 | |
---|
67 | // ----- Register |
---|
68 | reg_DATA = new SC_REGISTER (Tdata_t) * [_param._nb_word]; |
---|
69 | |
---|
70 | for (uint32_t i=0; i<_param._nb_word; i++) |
---|
71 | { |
---|
72 | string rename = "reg_DATA[" + toString(i) + "]"; |
---|
73 | reg_DATA [i] = new SC_REGISTER (Tdata_t) (rename.c_str()); |
---|
74 | } |
---|
75 | }; |
---|
76 | |
---|
77 | }; // end namespace registerfile |
---|
78 | }; // end namespace generic |
---|
79 | }; // end namespace behavioural |
---|
80 | }; // end namespace morpheo |
---|
81 | #endif |
---|