[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 | |
---|
[41] | 17 | void RegisterFile_Monolithic::vhdl_body (Vhdl * & vhdl) |
---|
[2] | 18 | { |
---|
[41] | 19 | vhdl->set_body (""); |
---|
| 20 | vhdl->set_body ("-----------------------------------------------------------------------------"); |
---|
[55] | 21 | vhdl->set_body ("-- Ackitement"); |
---|
| 22 | vhdl->set_body ("-----------------------------------------------------------------------------"); |
---|
| 23 | vhdl->set_body (""); |
---|
| 24 | |
---|
| 25 | for (uint32_t i = 0; i < _param->_nb_port_read; i++) |
---|
| 26 | vhdl->set_body ("out_READ_"+toString(i)+"_ACK <= '1';"); |
---|
| 27 | for (uint32_t i = 0; i < _param->_nb_port_write; i++) |
---|
| 28 | vhdl->set_body ("out_WRITE_"+toString(i)+"_ACK <= '1';"); |
---|
| 29 | for (uint32_t i = 0; i < _param->_nb_port_read_write; i++) |
---|
| 30 | vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_ACK <= '1';"); |
---|
| 31 | |
---|
| 32 | vhdl->set_body (""); |
---|
| 33 | vhdl->set_body ("-----------------------------------------------------------------------------"); |
---|
[41] | 34 | vhdl->set_body ("-- Read RegisterFile"); |
---|
| 35 | vhdl->set_body ("-----------------------------------------------------------------------------"); |
---|
| 36 | vhdl->set_body (""); |
---|
[2] | 37 | |
---|
[55] | 38 | for (uint32_t i = 0; i < _param->_nb_port_read; i++) |
---|
| 39 | vhdl->set_body ("out_READ_"+toString(i)+"_DATA <= reg_DATA (conv_integer(in_READ_"+toString(i)+"_ADDRESS)) when in_READ_"+toString(i)+"_VAL = '1' else "+std_logic_others(_param->_size_word,0)+";"); |
---|
[2] | 40 | |
---|
[55] | 41 | for (uint32_t i = 0; i < _param->_nb_port_read_write; i++) |
---|
| 42 | vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_RDATA <= reg_DATA (conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)) when in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_READ)+"' else "+std_logic_others(_param->_size_word,0)+";"); |
---|
| 43 | |
---|
[41] | 44 | vhdl->set_body (""); |
---|
| 45 | vhdl->set_body ("-----------------------------------------------------------------------------"); |
---|
| 46 | vhdl->set_body ("-- Write RegisterFile"); |
---|
| 47 | vhdl->set_body ("-----------------------------------------------------------------------------"); |
---|
| 48 | vhdl->set_body (""); |
---|
| 49 | |
---|
| 50 | vhdl->set_body ("RegisterFile_write: process (in_CLOCK)"); |
---|
| 51 | vhdl->set_body ("begin -- process RegisterFile_write"); |
---|
| 52 | vhdl->set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then"); |
---|
[2] | 53 | |
---|
[55] | 54 | for (uint32_t i = 0; i < _param->_nb_port_write; i++) |
---|
[2] | 55 | { |
---|
[41] | 56 | vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then"); |
---|
| 57 | vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)) <= in_WRITE_"+toString(i)+"_DATA;"); |
---|
| 58 | vhdl->set_body ("\t\tend if;"); |
---|
[2] | 59 | } |
---|
[55] | 60 | for (uint32_t i = 0; i < _param->_nb_port_read_write; i++) |
---|
| 61 | { |
---|
| 62 | vhdl->set_body ("\t\tif (in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_WRITE)+"') then"); |
---|
| 63 | vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_READ_WRITE_"+toString(i)+"_ADDRESS)) <= in_READ_WRITE_"+toString(i)+"_WDATA;"); |
---|
| 64 | vhdl->set_body ("\t\tend if;"); |
---|
| 65 | } |
---|
[2] | 66 | |
---|
[41] | 67 | vhdl->set_body ("\tend if;"); |
---|
| 68 | vhdl->set_body ("end process RegisterFile_write;"); |
---|
[2] | 69 | }; |
---|
| 70 | |
---|
[15] | 71 | }; // end namespace registerfile_monolithic |
---|
[2] | 72 | }; // end namespace registerfile |
---|
| 73 | }; // end namespace generic |
---|
| 74 | }; // end namespace behavioural |
---|
| 75 | }; // end namespace morpheo |
---|
| 76 | #endif |
---|