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

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

Vhdl_Testbench : Modification du testbench. Maintenant complétement encapsuler dans la classe "Interfaces".
Suppression de la class Vhdl_Testbench dans un avenir proche :D
Suppression du répertoire Configuration.old

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_"+toString(i)+"_ACK  <= '1';");
28        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)+";");
29      }
30
31    vhdl->set_body ("");
32    vhdl->set_body ("-----------------------------------------------------------------------------");
33    vhdl->set_body ("-- Write RegisterFile");
34    vhdl->set_body ("-----------------------------------------------------------------------------");
35    vhdl->set_body ("");
36
37    vhdl->set_body ("RegisterFile_write: process (in_CLOCK)");
38    vhdl->set_body ("begin  -- process RegisterFile_write");
39    vhdl->set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then");
40   
41    for (uint32_t i = 0; i < _param._nb_port_write; i++)
42      {
43      vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then");
44      vhdl->set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_"+toString(i)+"_ADDRESS)) <= in_WRITE_"+toString(i)+"_DATA;");
45      vhdl->set_body ("\t\tend if;");
46      }
47
48    vhdl->set_body ("\tend if;");
49    vhdl->set_body ("end process RegisterFile_write;");
50
51    for (uint32_t i = 0; i < _param._nb_port_write; i++)
52      vhdl->set_body ("out_WRITE_"+toString(i)+"_ACK <= '1';");
53  };
54
55}; // end namespace registerfile_monolithic
56}; // end namespace registerfile
57}; // end namespace generic
58}; // end namespace behavioural         
59}; // end namespace morpheo             
60#endif
Note: See TracBrowser for help on using the repository browser.