Ignore:
Timestamp:
Mar 21, 2007, 5:00:06 PM (17 years ago)
Author:
rosiere
Message:

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
Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/Parameters_msg_error.cpp

    r2 r6  
    3939      {
    4040        msg += "  - nb_word must be >= 2\n";
    41         msg +=  "    * nb_word                         : " + toString(_nb_word)    + "\n";
     41        msg += "    * nb_word                         : " + toString(_nb_word)    + "\n";
    4242      }
    4343
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile.cpp

    r2 r6  
    5353    sensitive_neg << *(in_CLOCK);
    5454    for (uint32_t i=0; i<_param._nb_port_read; i++)
    55       sensitive << *(in_READ_ENABLE  [i])
     55      sensitive << *(in_READ_VAL     [i])
    5656                << *(in_READ_ADDRESS [i]);
    5757
     
    6060    for (uint32_t i=0; i<_param._nb_port_read; i++)
    6161      {
    62         (*(out_READ_DATA [i])) (*( in_READ_ENABLE  [i]));
     62        (*(out_READ_DATA [i])) (*( in_READ_VAL     [i]));
    6363        (*(out_READ_DATA [i])) (*( in_READ_ADDRESS [i]));
    6464      }
    6565#endif   
     66
     67    for (uint32_t i=0; i<_param._nb_port_read ; i++)
     68      PORT_WRITE(out_READ_ACK  [i], 1);
     69    for (uint32_t i=0; i<_param._nb_port_write; i++)
     70      PORT_WRITE(out_WRITE_ACK [i], 1);
    6671#endif
    6772  };
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_allocation.cpp

    r2 r6  
    1616  void RegisterFile::allocation (void)
    1717  {
    18     in_CLOCK = new SC_CLOCK ("in_CLOCK");
     18    in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
     19    in_NRESET = new SC_IN (Tcontrol_t) ("in_NRESET");
    1920
    2021    // ----- Interface Read
    21      in_READ_ENABLE      = new SC_IN (Tcontrol_t) * [_param._nb_port_read];
     22     in_READ_VAL         = new SC_IN (Tcontrol_t) * [_param._nb_port_read];
     23    out_READ_ACK         = new SC_OUT(Tcontrol_t) * [_param._nb_port_read];
    2224     in_READ_ADDRESS     = new SC_IN (Taddress_t) * [_param._nb_port_read];
    2325    out_READ_DATA        = new SC_OUT(Tdata_t   ) * [_param._nb_port_read];
     
    2729        string rename;
    2830
    29         rename = "in_READ_ENABLE["  + toString(i) + "]";
    30         in_READ_ENABLE  [i]  = new SC_IN (Tcontrol_t) (rename.c_str());
     31        rename = "in_READ_VAL["     + toString(i) + "]";
     32        in_READ_VAL     [i]  = new SC_IN (Tcontrol_t) (rename.c_str());
     33
     34        rename = "out_READ_ACK["     + toString(i) + "]";
     35        out_READ_ACK    [i]  = new SC_OUT(Tcontrol_t) (rename.c_str());
    3136
    3237        rename = "in_READ_ADDRESS[" + toString(i) + "]";
     
    3843
    3944    // ----- Interface Write
    40      in_WRITE_ENABLE     = new SC_IN (Tcontrol_t) * [_param._nb_port_write];
     45     in_WRITE_VAL        = new SC_IN (Tcontrol_t) * [_param._nb_port_write];
     46    out_WRITE_ACK        = new SC_OUT(Tcontrol_t) * [_param._nb_port_write];
    4147     in_WRITE_ADDRESS    = new SC_IN (Taddress_t) * [_param._nb_port_write];
    4248     in_WRITE_DATA       = new SC_IN (Tdata_t   ) * [_param._nb_port_write];
     
    4652        string rename;
    4753
    48         rename = "in_WRITE_ENABLE["  + toString(i) + "]";
    49         in_WRITE_ENABLE  [i]  = new SC_IN (Tcontrol_t) (rename.c_str());
     54        rename = "in_WRITE_VAL["  + toString(i) + "]";
     55        in_WRITE_VAL     [i]  = new SC_IN (Tcontrol_t) (rename.c_str());
     56
     57        rename = "out_WRITE_VAL["  + toString(i) + "]";
     58        out_WRITE_ACK    [i]  = new SC_OUT(Tcontrol_t) (rename.c_str());
    5059
    5160        rename = "in_WRITE_ADDRESS[" + toString(i) + "]";
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_deallocation.cpp

    r2 r6  
    1717  {
    1818    delete in_CLOCK;
    19 
     19    delete in_NRESET;
    2020    // ----- Interface Read
    2121    for (uint32_t i=0; i<_param._nb_port_read; i++)
    2222      {
    23         delete in_READ_ENABLE  [i];
    24         delete in_READ_ADDRESS [i];
    25         delete out_READ_DATA   [i];
     23        delete  in_READ_VAL     [i];
     24        delete out_READ_ACK     [i];
     25        delete  in_READ_ADDRESS [i];
     26        delete out_READ_DATA    [i];
    2627      }
    2728
    28     delete  in_READ_ENABLE ;
     29    delete  in_READ_VAL    ;
     30    delete out_READ_ACK    ;
    2931    delete  in_READ_ADDRESS;
    3032    delete out_READ_DATA   ;
     
    3335    for (uint32_t i=0; i<_param._nb_port_write; i++)
    3436      {
    35         delete in_WRITE_ENABLE  [i];
    36         delete in_WRITE_ADDRESS [i];
    37         delete in_WRITE_DATA    [i];
     37        delete  in_WRITE_VAL     [i];
     38        delete out_WRITE_ACK     [i];
     39        delete  in_WRITE_ADDRESS [i];
     40        delete  in_WRITE_DATA    [i];
    3841      }
    3942
    40     delete in_WRITE_ENABLE ;
    41     delete in_WRITE_ADDRESS;
    42     delete in_WRITE_DATA   ;
     43    delete  in_WRITE_VAL    ;
     44    delete out_WRITE_ACK    ;
     45    delete  in_WRITE_ADDRESS;
     46    delete  in_WRITE_DATA   ;
    4347
    4448    // ----- Register
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_genMealy_read.cpp

    r3 r6  
    2525      {
    2626        // Have a write?
    27         if ( PORT_READ(in_READ_ENABLE[i]) == 1)
     27        if ( PORT_READ(in_READ_VAL [i]) == 1)
    2828          {
    2929            Taddress_t address = PORT_READ(in_READ_ADDRESS[i]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_transition.cpp

    r3 r6  
    2424      {
    2525        // Have a write?
    26         if ( PORT_READ(in_WRITE_ENABLE[i]) == true)
     26        if ( PORT_READ(in_WRITE_VAL[i]) == true)
    2727          {
    2828#ifdef STATISTICS
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_body.cpp

    r2 r6  
    2323   
    2424    for (uint32_t i = 0; i < _param._nb_port_read; i++)
    25       vhdl.set_body ("out_READ_DATA_"+toString(i)+" <= reg_DATA (conv_integer(in_READ_ADDRESS_"+toString(i)+")) when in_READ_ENABLE_"+toString(i)+" = '1' else "+std_logic_others(_param._size_word,0)+";");
    26 
     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      }
    2729    vhdl.set_body ("");
    2830    vhdl.set_body ("-----------------------------------------------------------------------------");
     
    3739    for (uint32_t i = 0; i < _param._nb_port_write; i++)
    3840      {
    39       vhdl.set_body ("\t\tif (in_WRITE_ENABLE_"+toString(i)+" = '1') then");
     41      vhdl.set_body ("\t\tif (in_WRITE_VAL_"+toString(i)+" = '1') then");
    4042      vhdl.set_body ("\t\t\treg_DATA(conv_integer(in_WRITE_ADDRESS_"+toString(i)+")) <= in_WRITE_DATA_"+toString(i)+";");
    4143      vhdl.set_body ("\t\tend if;");
     
    4446    vhdl.set_body ("\tend if;");
    4547    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';");
    4651  };
    4752
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_port.cpp

    r2 r6  
    1616  void RegisterFile::vhdl_port (Vhdl & vhdl)
    1717  {
    18     vhdl.set_port ("in_CLOCK", IN, "std_logic");
     18    vhdl.set_port ("in_CLOCK" , IN, 1);
     19    vhdl.set_port ("in_NRESET", IN, 1);
    1920
    2021    for (uint32_t i = 0; i < _param._nb_port_read; i ++)
    2122      {
    22         vhdl.set_port (" in_READ_ENABLE_"+toString(i)+" ",IN ,std_logic(1)                    );
     23        vhdl.set_port (" in_READ_VAL_"+toString(i)+"    ",IN ,std_logic(1)                    );
     24        vhdl.set_port ("out_READ_ACK_"+toString(i)+"    ",OUT,std_logic(1)                    );
    2325        vhdl.set_port (" in_READ_ADDRESS_"+toString(i)+"",IN ,std_logic(static_cast<uint32_t>(log2(_param._nb_word))));
    2426        vhdl.set_port ("out_READ_DATA_"+toString(i)+"   ",OUT,std_logic(_param._size_word    ));
     
    2729    for (uint32_t i = 0; i < _param._nb_port_write; i ++)
    2830      {
    29         vhdl.set_port (" in_WRITE_ENABLE_"+toString(i)+" ",IN ,std_logic(1)                    );
     31        vhdl.set_port (" in_WRITE_VAL_"+toString(i)+"    ",IN ,std_logic(1)                    );
     32        vhdl.set_port ("out_WRITE_ACK_"+toString(i)+"    ",OUT,std_logic(1)                    );
    3033        vhdl.set_port (" in_WRITE_ADDRESS_"+toString(i)+"",IN ,std_logic(static_cast<uint32_t>(log2(_param._nb_word))));
    3134        vhdl.set_port (" in_WRITE_DATA_"+toString(i)+"   ",IN ,std_logic(_param._size_word    ));
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_testbench_port.cpp

    r2 r6  
    1616  void RegisterFile::vhdl_testbench_port (Vhdl_Testbench & vhdl_testbench)
    1717  {
     18    vhdl_testbench.set_port (" in_NRESET",IN ,1);
     19
    1820    for (uint32_t i = 0; i < _param._nb_port_read; i ++)
    1921      {
    20         vhdl_testbench.set_port (" in_READ_ENABLE_"+toString(i)+" ",IN ,1);
     22        vhdl_testbench.set_port (" in_READ_VAL_"+toString(i)+"    ",IN ,1);
     23        vhdl_testbench.set_port ("out_READ_ACK_"+toString(i)+"    ",OUT,1);
    2124        vhdl_testbench.set_port (" in_READ_ADDRESS_"+toString(i)+"",IN ,static_cast<uint32_t>(log2(_param._nb_word)));
    2225        vhdl_testbench.set_port ("out_READ_DATA_"+toString(i)+"   ",OUT,_param._size_word);
     
    2528    for (uint32_t i = 0; i < _param._nb_port_write; i ++)
    2629      {
    27         vhdl_testbench.set_port (" in_WRITE_ENABLE_"+toString(i)+" ",IN ,1);
     30        vhdl_testbench.set_port (" in_WRITE_VAL_"+toString(i)+"    ",IN ,1);
     31        vhdl_testbench.set_port ("out_WRITE_ACK_"+toString(i)+"    ",OUT,1);
    2832        vhdl_testbench.set_port (" in_WRITE_ADDRESS_"+toString(i)+"",IN ,static_cast<uint32_t>(log2(_param._nb_word)));
    2933        vhdl_testbench.set_port (" in_WRITE_DATA_"+toString(i)+"   ",IN ,_param._size_word    );
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/RegisterFile/src/RegisterFile_vhdl_testbench_transition.cpp

    r2 r6  
    1919    sc_cycle(0);
    2020#endif
     21    vhdl_testbench.add_input (PORT_READ( in_NRESET));
    2122
    2223    for (uint32_t i = 0; i < _param._nb_port_read ; i ++)
    2324      {
    24         vhdl_testbench.add_input (PORT_READ( in_READ_ENABLE  [i]));
     25        vhdl_testbench.add_input (PORT_READ( in_READ_VAL     [i]));
     26        vhdl_testbench.add_output(PORT_READ(out_READ_ACK     [i]));
    2527        vhdl_testbench.add_input (PORT_READ( in_READ_ADDRESS [i]));
     28        vhdl_testbench.add_output(PORT_READ(out_READ_DATA    [i]));
    2629      }
    2730    for (uint32_t i = 0; i < _param._nb_port_write; i ++)
    2831      {
    29         vhdl_testbench.add_input (PORT_READ( in_WRITE_ENABLE [i]));
     32        vhdl_testbench.add_input (PORT_READ( in_WRITE_VAL    [i]));
     33        vhdl_testbench.add_output(PORT_READ(out_WRITE_ACK    [i]));
    3034        vhdl_testbench.add_input (PORT_READ( in_WRITE_ADDRESS[i]));
    3135        vhdl_testbench.add_input (PORT_READ( in_WRITE_DATA   [i]));
    32       }
    33     for (uint32_t i = 0; i < _param._nb_port_read ; i ++)
    34       {
    35         vhdl_testbench.add_output(PORT_READ(out_READ_DATA    [i]));
    3636      }
    3737
Note: See TracChangeset for help on using the changeset viewer.