source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_body.cpp @ 6

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

Banc de registres

  • ajout de 2 ports additionnels inutiles (reset et ack) mais nécessaire pour uniformisé les différentes version du banc de registres
File size: 2.1 KB
Line 
1#ifdef VHDL
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/RegisterFile/include/RegisterFile.h"
10
11namespace morpheo                    {
12namespace behavioural                {
13namespace generic                    {
14namespace registerfile               {
15
16  void RegisterFile::vhdl_body (Vhdl & vhdl)
17  {
18    vhdl.set_body ("");
19    vhdl.set_body ("-----------------------------------------------------------------------------");
20    vhdl.set_body ("-- Read RegisterFile");
21    vhdl.set_body ("-----------------------------------------------------------------------------");
22    vhdl.set_body ("");
23   
24    for (uint32_t i = 0; i < _param._nb_port_read; i++)
25      {
26        vhdl.set_body ("out_READ_ACK_"+toString(i)+"  <= '1';");
27        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)+";");
28      }
29    vhdl.set_body ("");
30    vhdl.set_body ("-----------------------------------------------------------------------------");
31    vhdl.set_body ("-- Write RegisterFile");
32    vhdl.set_body ("-----------------------------------------------------------------------------");
33    vhdl.set_body ("");
34
35    vhdl.set_body ("RegisterFile_write: process (in_CLOCK)");
36    vhdl.set_body ("begin  -- process RegisterFile_write");
37    vhdl.set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then");
38   
39    for (uint32_t i = 0; i < _param._nb_port_write; i++)
40      {
41      vhdl.set_body ("\t\tif (in_WRITE_VAL_"+toString(i)+" = '1') then");
42      vhdl.set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_ADDRESS_"+toString(i)+")) <= in_WRITE_DATA_"+toString(i)+";");
43      vhdl.set_body ("\t\tend if;");
44      }
45
46    vhdl.set_body ("\tend if;");
47    vhdl.set_body ("end process RegisterFile_write;");
48
49    for (uint32_t i = 0; i < _param._nb_port_write; i++)
50      vhdl.set_body ("out_WRITE_ACK_"+toString(i)+"<= '1';");
51  };
52
53}; // end namespace registerfile
54}; // end namespace generic
55}; // end namespace behavioural         
56}; // end namespace morpheo             
57#endif
Note: See TracBrowser for help on using the repository browser.