Ignore:
Timestamp:
Dec 15, 2008, 12:04:03 PM (16 years ago)
Author:
rosiere
Message:

Update document on Vhdl generation.

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/include/test.h

    r81 r94  
    1313#include <iostream>
    1414#include <sys/time.h>
    15 
     15#include "Common/include/Time.h"
    1616#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/include/RegisterFile_Monolithic.h"
    1717
     
    2626             morpheo::behavioural::generic::registerfile::registerfile_monolithic::Parameters * param);
    2727
    28 class Time
    29 {
    30 private : timeval time_begin;
    31 // private : timeval time_end;
    32  
    33 public  : Time ()
    34   {
    35     gettimeofday(&time_begin     ,NULL);
    36   };
    37 
    38 public  : ~Time ()
    39   {
    40     cout << *this;
    41   };
    42 
    43 public  : friend ostream& operator<< (ostream& output_stream,
    44                                       const Time & x)
    45   {
    46     timeval time_end;
    47    
    48     gettimeofday(&time_end       ,NULL);
    49    
    50     uint32_t nb_cycles = static_cast<uint32_t>(sc_simulation_time());
    51 
    52     double average = static_cast<double>(nb_cycles) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec);
    53    
    54     output_stream << nb_cycles << "\t(" << average << " cycles / seconds )" << endl;
    55 
    56     return output_stream;
    57   }
    58 };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/src/test.cpp

    r88 r94  
    22 * $Id$
    33 *
    4  * [ Description ]
     4 * [ Description ]
    55 *
    66 * Test
    77 */
    88
    9 #define NB_ITERATION 16
    10 #define CYCLE_MAX    1024*NB_ITERATION
     9#define NB_ITERATION 1
     10#define CYCLE_MAX    100000*NB_ITERATION
    1111#include "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/SelfTest/include/test.h"
    1212#include "Common/include/Test.h"
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_body.cpp

    r81 r94  
    1717  void RegisterFile_Monolithic::vhdl_body (Vhdl * & vhdl)
    1818  {
    19     vhdl->set_body ("");
    20     vhdl->set_body ("-----------------------------------------------------------------------------");
    21     vhdl->set_body ("-- Ackitement");
    22     vhdl->set_body ("-----------------------------------------------------------------------------");
    23     vhdl->set_body ("");
     19    vhdl->set_body   (0,"");
     20    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     21    vhdl->set_comment(0," Ackitement");
     22    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     23    vhdl->set_body   (0,"");
    2424
    2525    for (uint32_t i = 0; i < _param->_nb_port_read; i++)
    26       vhdl->set_body ("out_READ_"+toString(i)+"_ACK  <= '1';");
     26      vhdl->set_body   (0,"out_READ_"+toString(i)+"_ACK  <= '1';");
    2727    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
    28       vhdl->set_body ("out_WRITE_"+toString(i)+"_ACK <= '1';");
     28      vhdl->set_body   (0,"out_WRITE_"+toString(i)+"_ACK <= '1';");
    2929    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
    30       vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_ACK  <= '1';");
     30      vhdl->set_body   (0,"out_READ_WRITE_"+toString(i)+"_ACK  <= '1';");
    3131
    32     vhdl->set_body ("");
    33     vhdl->set_body ("-----------------------------------------------------------------------------");
    34     vhdl->set_body ("-- Read RegisterFile");
    35     vhdl->set_body ("-----------------------------------------------------------------------------");
    36     vhdl->set_body ("");
     32    vhdl->set_body   (0,"");
     33    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     34    vhdl->set_comment(0," Read RegisterFile");
     35    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     36    vhdl->set_body   (0,"");
    3737   
    3838    for (uint32_t i = 0; i < _param->_nb_port_read; i++)
     
    4444          str_address = "0";
    4545
    46         vhdl->set_body ("out_READ_"+toString(i)+"_DATA <= reg_DATA ("+str_address+") when in_READ_"+toString(i)+"_VAL = '1' else "+std_logic_others(_param->_size_word,0)+";");
     46        vhdl->set_body   (0,"out_READ_"+toString(i)+"_DATA <= reg_DATA ("+str_address+") when in_READ_"+toString(i)+"_VAL = '1' else "+std_logic_others(_param->_size_word,0)+";");
    4747      }
    4848    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
     
    5353        else
    5454          str_address = "0";
    55         vhdl->set_body ("out_READ_WRITE_"+toString(i)+"_RDATA <= reg_DATA ("+str_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)+";");
     55        vhdl->set_body   (0,"out_READ_WRITE_"+toString(i)+"_RDATA <= reg_DATA ("+str_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)+";");
    5656      }
    5757
    58     vhdl->set_body ("");
    59     vhdl->set_body ("-----------------------------------------------------------------------------");
    60     vhdl->set_body ("-- Write RegisterFile");
    61     vhdl->set_body ("-----------------------------------------------------------------------------");
    62     vhdl->set_body ("");
     58    vhdl->set_body   (0,"");
     59    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     60    vhdl->set_comment(0," Write RegisterFile");
     61    vhdl->set_comment(0,"---------------------------------------------------------------------------");
     62    vhdl->set_body   (0,"");
    6363
    64     vhdl->set_body ("RegisterFile_write: process (in_CLOCK)");
    65     vhdl->set_body ("begin  -- process RegisterFile_write");
    66     vhdl->set_body ("\tif in_CLOCK'event and in_CLOCK = '1' then");
     64    vhdl->set_body   (0,"RegisterFile_write: process (in_CLOCK)");
     65    vhdl->set_body   (0,"begin  -- process RegisterFile_write");
     66    vhdl->set_body   (1,"if in_CLOCK'event and in_CLOCK = '1' then");
    6767   
    6868    for (uint32_t i = 0; i < _param->_nb_port_write; i++)
     
    7474          str_address = "0";
    7575
    76         vhdl->set_body ("\t\tif (in_WRITE_"+toString(i)+"_VAL = '1') then");
    77         vhdl->set_body ("\t\t\treg_DATA("+str_address+") <= in_WRITE_"+toString(i)+"_DATA;");
    78         vhdl->set_body ("\t\tend if;");
     76        vhdl->set_body   (2,"if (in_WRITE_"+toString(i)+"_VAL = '1') then");
     77        vhdl->set_body   (3,"reg_DATA("+str_address+") <= in_WRITE_"+toString(i)+"_DATA;");
     78        vhdl->set_body   (2,"end if;");
    7979      }
    8080    for (uint32_t i = 0; i < _param->_nb_port_read_write; i++)
     
    8686          str_address = "0";
    8787       
    88         vhdl->set_body ("\t\tif (in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_WRITE)+"') then");
    89         vhdl->set_body ("\t\t\treg_DATA("+str_address+") <= in_READ_WRITE_"+toString(i)+"_WDATA;");
    90         vhdl->set_body ("\t\tend if;");
     88        vhdl->set_body   (2,"if (in_READ_WRITE_"+toString(i)+"_VAL = '1' and in_READ_WRITE_"+toString(i)+"_RW = '"+toString(RW_WRITE)+"') then");
     89        vhdl->set_body   (3,"reg_DATA("+str_address+") <= in_READ_WRITE_"+toString(i)+"_WDATA;");
     90        vhdl->set_body   (2,"end if;");
    9191      }
    9292
    93     vhdl->set_body ("\tend if;");
    94     vhdl->set_body ("end process RegisterFile_write;");
     93    vhdl->set_body   (1,"end if;");
     94    vhdl->set_body   (0,"end process RegisterFile_write;");
    9595  };
    9696
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/RegisterFile_Monolithic/src/RegisterFile_Monolithic_vhdl_declaration.cpp

    r81 r94  
    1818  void RegisterFile_Monolithic::vhdl_declaration (Vhdl * & vhdl)
    1919  {
    20     vhdl->set_type ("Tregfile", "array (" + toString(_param->_nb_word-1) + " downto 0) of " + std_logic(_param->_size_word));
     20    vhdl->set_type ("Tregfile", "array " + std_logic_range(_param->_nb_word,true) + " of " + std_logic(_param->_size_word));
    2121
    2222    vhdl->set_signal ("reg_DATA", "Tregfile");
Note: See TracChangeset for help on using the changeset viewer.