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