Changeset 103 for trunk


Ignore:
Timestamp:
Oct 4, 2010, 5:37:12 PM (14 years ago)
Author:
choichil
Message:

Platform using vci_simple_ram which is not the svn working copy (allow broadcast write commands ) and mapping table not filled yet

Location:
trunk/platforms/caba-vdspin-vci_synthetic_initiator
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/platforms/caba-vdspin-vci_synthetic_initiator/platform_desc

    r99 r103  
    99                       ring_rsp_data_size = 33,
    1010                  ),
     11                  Uses('caba:vci_simple_ram'),
    1112                  Uses('caba:virtual_dspin_router', flit_width = 40),
    1213                  Uses('caba:virtual_dspin_router', flit_width = 33),
     14                  Uses('common:loader'),
    1315                ],
    1416                  cell_size = 4,
    1517                  plen_size = 8,
    16                   addr_size = 32,
    17                   rerror_size = 2,
     18                  addr_size = 40,
     19                  rerror_size = 1,
    1820                  clen_size = 1,
    1921                  rflag_size = 1,
  • trunk/platforms/caba-vdspin-vci_synthetic_initiator/top.cpp

    r99 r103  
    11
     2#include <stdint.h>
    23#include <systemc>
    34#include <sys/time.h>
     
    67#include <cstdarg>
    78
     9#include "arithmetics.h"
    810#include "mapping_table.h"
    911#include "alloc_elems.h"
    10 //#include "vci_simple_ram.h"
     12#include "vci_simple_ram.h"
    1113//#include "vci_multi_tty.h"
    1214#include "vci_local_ring_fast.h"
     
    3941
    4042        // Define VCI parameters
    41         typedef soclib::caba::VciParams<4,8,32,1,1,1,8,4,4,1> vci_param;
    42 
     43        typedef soclib::caba::VciParams<4,8,40,1,1,1,8,4,4,1> vci_param;
     44
     45       
     46        soclib::common::Loader loader(NULL);
    4347        // Mapping table primary network
    44 
    45         soclib::common::MappingTable maptab(32, IntTab(2,10), IntTab(2,3), 0x00C00000);
    46 
    47 
    48         maptab.add(Segment("mc_r0" , MC0_R_BASE , MC0_R_SIZE , IntTab(0,0), false, true, IntTab(0,0)));
    49         maptab.add(Segment("mc_m0" , MC0_M_BASE , MC0_M_SIZE , IntTab(0,0), true ));
    50         maptab.add(Segment("mc_r1" , MC1_R_BASE , MC1_R_SIZE , IntTab(1,0), false, true, IntTab(1,0)));
    51         maptab.add(Segment("mc_m1" , MC1_M_BASE , MC1_M_SIZE , IntTab(1,0), true ));
    52         maptab.add(Segment("mc_r2" , MC2_R_BASE , MC2_R_SIZE , IntTab(2,0), false, true, IntTab(2,0)));
    53         maptab.add(Segment("mc_m2" , MC2_M_BASE , MC2_M_SIZE , IntTab(2,0), true ));
    54         maptab.add(Segment("mc_r3" , MC3_R_BASE , MC3_R_SIZE , IntTab(3,0), false, true, IntTab(3,0)));
    55         maptab.add(Segment("mc_m3" , MC3_M_BASE , MC3_M_SIZE , IntTab(3,0), true ));
    56 
    57         std::cout << maptab << std::endl;
    58 
     48       
     49        soclib::common::MappingTable maptab0(40, IntTab(2,10), IntTab(2,3), 0x00C00000);
     50        soclib::common::MappingTable maptab1(40, IntTab(2,10), IntTab(2,3), 0x00C00000);
     51
     52
     53        //maptab0.add(Segment("mc_r0" , MC0_R_BASE , MC0_R_SIZE , IntTab(0,0), false, true, IntTab(0,0)));
     54        //maptab0.add(Segment("mc_m0" , MC0_M_BASE , MC0_M_SIZE , IntTab(0,0), true ));
     55        //maptab0.add(Segment("mc_r1" , MC1_R_BASE , MC1_R_SIZE , IntTab(1,0), false, true, IntTab(1,0)));
     56        //maptab0.add(Segment("mc_m1" , MC1_M_BASE , MC1_M_SIZE , IntTab(1,0), true ));
     57        //maptab0.add(Segment("mc_r2" , MC2_R_BASE , MC2_R_SIZE , IntTab(2,0), false, true, IntTab(2,0)));
     58        //maptab0.add(Segment("mc_m2" , MC2_M_BASE , MC2_M_SIZE , IntTab(2,0), true ));
     59        //maptab0.add(Segment("mc_r3" , MC3_R_BASE , MC3_R_SIZE , IntTab(3,0), false, true, IntTab(3,0)));
     60        //maptab0.add(Segment("mc_m3" , MC3_M_BASE , MC3_M_SIZE , IntTab(3,0), true ));
     61
     62        std::cout << maptab0 << std::endl;
    5963        // Signals
    6064
     
    6266        sc_signal<bool> signal_resetn("resetn");
    6367   
    64         soclib::caba::VciSignals<vci_param> * signal_vci_ini_synth_c0 = soclib::common::alloc_elems<soclib::caba::VciSignals<vci_param> >("signal_vci_ini_synth", N_CLUSTERS);
    65         soclib::caba::VciSignals<vci_param> * signal_vci_ini_synth_c1 = soclib::common::alloc_elems<soclib::caba::VciSignals<vci_param> >("signal_vci_ini_synth", N_CLUSTERS);
     68        soclib::caba::VciSignals<vci_param> ** signal_vci_ini_synth_c0 = soclib::common::alloc_elems<soclib::caba::VciSignals<vci_param> >("signal_vci_ini_synth", 2, N_CLUSTERS);
     69        soclib::caba::VciSignals<vci_param> ** signal_vci_ini_synth_c1 = soclib::common::alloc_elems<soclib::caba::VciSignals<vci_param> >("signal_vci_ini_synth", 2, N_CLUSTERS);
    6670        ///////////////////////////////////////////////////////////////
    6771        // VDSPIN Signals : one level for in and out, one level for X length in the mesh,
    6872        //                  one level for Y length in the mesh, last level for each port of the router
    6973        ///////////////////////////////////////////////////////////////
    70         soclib::caba::DspinSignals<WIDTH_CMD> **** dspin_signals_cmd_c0 = soclib::common::alloc_elems<solib::caba::DspinSignals<WIDTH_CMD> >("Dspin_cmd_signals_channel_0", 2, Y_MAX, X_MAX, 5 );
    71         soclib::caba::DspinSignals<WIDTH_CMD> **** dspin_signals_cmd_c1 = soclib::common::alloc_elems<solib::caba::DspinSignals<WIDTH_CMD> >("Dspin_cmd_signals_channel_1", 2, Y_MAX, X_MAX, 5 );
    72         soclib::caba::DspinSignals<WIDTH_RSP> **** dspin_signals_rsp_c0 = soclib::common::alloc_elems<solib::caba::DspinSignals<WIDTH_RSP> >("Dspin_rsp_signals_channel_0", 2, Y_MAX, X_MAX, 5 );
    73         soclib::caba::DspinSignals<WIDTH_RSP> **** dspin_signals_rsp_c1 = soclib::common::alloc_elems<solib::caba::DspinSignals<WIDTH_RSP> >("Dspin_rsp_signals_channel_2", 2, Y_MAX, X_MAX, 5 );
     74        soclib::caba::DspinSignals<WIDTH_CMD> **** dspin_signals_cmd_c0 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_CMD> >("Dspin_cmd_signals_channel_0", 2, Y_MAX, X_MAX, 5 );
     75        soclib::caba::DspinSignals<WIDTH_CMD> **** dspin_signals_cmd_c1 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_CMD> >("Dspin_cmd_signals_channel_1", 2, Y_MAX, X_MAX, 5 );
     76        soclib::caba::DspinSignals<WIDTH_RSP> **** dspin_signals_rsp_c0 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_RSP> >("Dspin_rsp_signals_channel_0", 2, Y_MAX, X_MAX, 5 );
     77        soclib::caba::DspinSignals<WIDTH_RSP> **** dspin_signals_rsp_c1 = soclib::common::alloc_elems<soclib::caba::DspinSignals<WIDTH_RSP> >("Dspin_rsp_signals_channel_2", 2, Y_MAX, X_MAX, 5 );
    7478
    7579        //soclib::caba::VciSignals<vci_param> * signal_vci_tgt_proc  = soclib::common::alloc_elems<soclib::caba::VciSignals<vci_param> >("signal_vci_tgt_proc",  N_CLUSTERS);
     
    7781        // N_CLUSTERS ring.
    7882        soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> * local_ring_c0 = (soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> *) malloc(sizeof(soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ) * N_CLUSTERS) ;
    79         for(int i = 0 ; i < N_CLUSTERS ; i++){                                                            // ringid, fifo, fifo, nb_init, nb_tgt
    80                 new(&local_ring_c0[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ("cluster_c0" + i,maptab, IntTab(i), 2, 18, 1, 1)
    81         }
    82 
    8383        soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> * local_ring_c1 = (soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> *) malloc(sizeof(soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ) * N_CLUSTERS) ;
    8484        for(int i = 0 ; i < N_CLUSTERS ; i++){                                                            // ringid, fifo, fifo, nb_init, nb_tgt
    85                 new(&local_ring_c1[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ("cluster_c1" + i,maptab, IntTab(i), 2, 18, 1, 1)
     85                new(&local_ring_c0[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ("cluster_c0" + i,maptab0, IntTab(i), 2, 18, 1, 1);
     86                new(&local_ring_c1[i]) soclib::caba::VciLocalRingFast<vci_param, WIDTH_CMD, WIDTH_RSP> ("cluster_c1" + i,maptab1, IntTab(i), 2, 18, 1, 1);
    8687        }
    8788
     
    106107        // N_CLUSTERS VCI Synthetic Initiator (1 initiator per cluster/network)
    107108        soclib::caba::VciSyntheticInitiator<vci_param> * initiator_c0 = (soclib::caba::VciSyntheticInitiator<vci_param> *) malloc(sizeof(soclib::caba::VciSyntheticInitiator<vci_param> )* N_CLUSTERS);
    108         for(int i = 0 ; i < Y_MAX; i++)
    109                 for(int j = 0 ; j < Y_MAX ; j++)
    110                         new(&initiator_c0[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> ("Initiator_c0" + (i*X_MAX+j), i*X_MAX+j, maptab, IntTab(i,j),16, 0.5, 2, X_MAX, Y_MAX);
    111 
    112109        soclib::caba::VciSyntheticInitiator<vci_param> * initiator_c1 = (soclib::caba::VciSyntheticInitiator<vci_param> *) malloc(sizeof(soclib::caba::VciSyntheticInitiator<vci_param> )* N_CLUSTERS);
    113110        for(int i = 0 ; i < Y_MAX; i++)
    114                 for(int j = 0 ; j < Y_MAX ; j++)
    115                         new(&initiator_c1[Y_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> ("Initiator_c1" + (i*X_MAX+j), i*X_MAX+j, maptab, IntTab(i,j),16, 0.5, 2, X_MAX, Y_MAX);
     111                for(int j = 0 ; j < X_MAX ; j++){
     112                        new(&initiator_c0[X_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> ("Initiator_c0" + (i*X_MAX+j), maptab0, IntTab(i,j), 16, 0.5, 2, X_MAX, Y_MAX ); //, 0, 0, 0, 0, 0);
     113                        new(&initiator_c1[X_MAX*i+j]) soclib::caba::VciSyntheticInitiator<vci_param> ("Initiator_c1" + (i*X_MAX+j), maptab0, IntTab(i,j), 16, 0.5, 2, X_MAX, Y_MAX ); //, 0, 0, 0, 0, 0);
     114                }
     115
     116        soclib::caba::VciSimpleRam<vci_param> * ram_c0 = (soclib::caba::VciSimpleRam<vci_param> *) malloc(sizeof(soclib::caba::VciSimpleRam<vci_param>) * N_CLUSTERS);
     117        soclib::caba::VciSimpleRam<vci_param> * ram_c1 = (soclib::caba::VciSimpleRam<vci_param> *) malloc(sizeof(soclib::caba::VciSimpleRam<vci_param>) * N_CLUSTERS);
     118        for(int i = 0 ; i < Y_MAX ; i++)
     119                for(int j = 0 ; j < X_MAX ; j++){
     120                        new(&ram_c0[X_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> ("Ram_target_c0" + (i*X_MAX+j), IntTab(i,j), maptab0, loader, 0);
     121                        new(&ram_c1[X_MAX*i+j]) soclib::caba::VciSimpleRam<vci_param> ("Ram_target_c1" + (i*X_MAX+j), IntTab(i,j), maptab1, loader, 0);
     122                }
    116123
    117124        ///////////////////////////////////////////////////////////////
     
    121128          local_ring_c0[i].p_clk(signal_clk);
    122129          local_ring_c0[i].p_resetn(signal_resetn);
    123           local_ring_c0[i].p_to_initiator[0](signal_vci_ini_synt_c0h[i]);
     130          local_ring_c0[i].p_to_initiator[0](signal_vci_ini_synth_c0[0][i]);
     131          local_ring_c0[i].p_to_target[0](signal_vci_ini_synth_c0[1][i]);
    124132          initiator_c0[i].p_clk(signal_clk);
    125133          initiator_c0[i].p_resetn(signal_resetn);
    126           initiator_c0[i].p_vci(signal_vci_ini_synth_c0[i]);
     134          initiator_c0[i].p_vci(signal_vci_ini_synth_c0[0][i]);
     135          ram_c0[i].p_clk(signal_clk);
     136          ram_c0[i].p_resetn(signal_resetn);
     137          ram_c0[i].p_vci(signal_vci_ini_synth_c0[1][i]);
    127138          local_ring_c1[i].p_clk(signal_clk);
    128139          local_ring_c1[i].p_resetn(signal_resetn);
    129           local_ring_c1[i].p_to_initiator[0](signal_vci_ini_synth_c1[i]);
     140          local_ring_c1[i].p_to_initiator[0](signal_vci_ini_synth_c1[0][i]);
     141          local_ring_c1[i].p_to_target[0](signal_vci_ini_synth_c1[1][i]);
    130142          initiator_c1[i].p_clk(signal_clk);
    131143          initiator_c1[i].p_resetn(signal_resetn);
    132           initiator_c1[i].p_vci(signal_vci_ini_synth_c1[i]);
     144          initiator_c1[i].p_vci(signal_vci_ini_synth_c1[0][i]);
     145          ram_c1[i].p_clk(signal_clk);
     146          ram_c1[i].p_resetn(signal_resetn);
     147          ram_c1[i].p_vci(signal_vci_ini_synth_c1[1][i]);
    133148        }
    134149       
     
    151166            local_ring_c1[i*X_MAX+j].p_gate_rsp_in( dspin_signals_rsp_c1[0][i][j][LOCAL]);
    152167            local_ring_c1[i*X_MAX+j].p_gate_rsp_out(dspin_signals_rsp_c1[1][i][j][LOCAL] );
    153             for(k = 0; k < 5; k++){
     168            for(int k = 0; k < 5; k++){
    154169              if(i == 0){
    155170                if(j == 0){
Note: See TracChangeset for help on using the changeset viewer.