source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp @ 15

Last change on this file since 15 was 15, checked in by rosiere, 17 years ago

Interface normalisé
Début du banc de registres multi niveaux

File size: 2.2 KB
Line 
1#ifdef VHDL
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
10
11namespace morpheo                    {
12namespace behavioural                {
13namespace generic                    {
14namespace registerfile               {
15namespace registerfile_monolithic    {
16
17  void RegisterFile_Monolithic::vhdl_body (Vhdl & vhdl)
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++)
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      }
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      {
42      vhdl.set_body ("\t\tif (in_WRITE_VAL_"+toString(i)+" = '1') then");
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;");
49
50    for (uint32_t i = 0; i < _param._nb_port_write; i++)
51      vhdl.set_body ("out_WRITE_ACK_"+toString(i)+"<= '1';");
52  };
53
54}; // end namespace registerfile_monolithic
55}; // end namespace registerfile
56}; // end namespace generic
57}; // end namespace behavioural         
58}; // end namespace morpheo             
59#endif
Note: See TracBrowser for help on using the repository browser.