[2] | 1 | #ifdef VHDL |
---|
| 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::vhdl_body (Vhdl & vhdl) |
---|
[2] | 18 | { |
---|
| 19 | vhdl.set_body (""); |
---|
| 20 | vhdl.set_body ("-----------------------------------------------------------------------------"); |
---|
| 21 | vhdl.set_body ("-- Read RegisterFile"); |
---|
| 22 | vhdl.set_body ("-----------------------------------------------------------------------------"); |
---|
| 23 | vhdl.set_body (""); |
---|
| 24 | |
---|
| 25 | for (uint32_t i = 0; i < _param._nb_port_read; i++) |
---|
[6] | 26 | { |
---|
| 27 | vhdl.set_body ("out_READ_ACK_"+toString(i)+" <= '1';"); |
---|
| 28 | vhdl.set_body ("out_READ_DATA_"+toString(i)+" <= reg_DATA (conv_integer(in_READ_ADDRESS_"+toString(i)+")) when in_READ_VAL_"+toString(i)+" = '1' else "+std_logic_others(_param._size_word,0)+";"); |
---|
| 29 | } |
---|
[2] | 30 | vhdl.set_body (""); |
---|
| 31 | vhdl.set_body ("-----------------------------------------------------------------------------"); |
---|
| 32 | vhdl.set_body ("-- Write RegisterFile"); |
---|
| 33 | vhdl.set_body ("-----------------------------------------------------------------------------"); |
---|
| 34 | vhdl.set_body (""); |
---|
| 35 | |
---|
| 36 | vhdl.set_body ("RegisterFile_write: process (in_CLOCK)"); |
---|
| 37 | vhdl.set_body ("begin -- process RegisterFile_write"); |
---|
| 38 | vhdl.set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then"); |
---|
| 39 | |
---|
| 40 | for (uint32_t i = 0; i < _param._nb_port_write; i++) |
---|
| 41 | { |
---|
[6] | 42 | vhdl.set_body ("\t\tif (in_WRITE_VAL_"+toString(i)+" = '1') then"); |
---|
[2] | 43 | vhdl.set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_ADDRESS_"+toString(i)+")) <= in_WRITE_DATA_"+toString(i)+";"); |
---|
| 44 | vhdl.set_body ("\t\tend if;"); |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | vhdl.set_body ("\tend if;"); |
---|
| 48 | vhdl.set_body ("end process RegisterFile_write;"); |
---|
[6] | 49 | |
---|
| 50 | for (uint32_t i = 0; i < _param._nb_port_write; i++) |
---|
| 51 | vhdl.set_body ("out_WRITE_ACK_"+toString(i)+"<= '1';"); |
---|
[2] | 52 | }; |
---|
| 53 | |
---|
[15] | 54 | }; // end namespace registerfile_monolithic |
---|
[2] | 55 | }; // end namespace registerfile |
---|
| 56 | }; // end namespace generic |
---|
| 57 | }; // end namespace behavioural |
---|
| 58 | }; // end namespace morpheo |
---|
| 59 | #endif |
---|