Changeset 467 for branches


Ignore:
Timestamp:
Jul 23, 2013, 5:23:13 PM (11 years ago)
Author:
cfuguet
Message:

Modifications in branches/v5 tsar_generic_xbar:

  • Adding preprocessor conditional statements for ALMOS support
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/v5/platforms/tsar_generic_xbar/top.cpp

    r466 r467  
    9696//      OS
    9797///////////////////////////////////////////////////
    98 #define USE_ALMOS 0
    99 
    100 #define almos_bootloader_pathname "bootloader.bin"
    101 #define almos_kernel_pathname     "kernel-soclib.bin@0xbfc10000:D"
    102 #define almos_archinfo_pathname   "arch-info.bin@0xBFC08000:D"
     98
     99//#define USE_ALMOS
     100#define USE_GIET
     101
     102#ifdef USE_ALMOS
     103#ifdef USE_GIET
     104#error "Can't use Two different OS"
     105#endif
     106#endif
     107
     108#ifndef USE_ALMOS
     109#ifndef USE_GIET
     110#error "You need to specify one OS"
     111#endif
     112#endif
    103113
    104114///////////////////////////////////////////////////
     
    142152//////////////////////i/////////////////////////////////////
    143153
    144 #include "hard_config.h"
     154#ifdef USE_ALMOS
     155#include "almos/hard_config.h"
     156#define PREFIX_OS "almos/"
     157#endif
     158#ifdef USE_GIET
     159#define PREFIX_OS "giet_vm/"
     160#include "giet_vm/hard_config.h"
     161#endif
    145162
    146163////////////////////////////////////////////////////////////
     
    162179#define L1_DSETS              64
    163180
     181#ifdef USE_ALMOS
     182#define FBUF_X_SIZE           512
     183#define FBUF_Y_SIZE           512
     184#endif
     185#ifdef USE_GIET
    164186#define FBUF_X_SIZE           128
    165187#define FBUF_Y_SIZE           128
    166 
     188#endif
     189
     190#ifdef USE_GIET
    167191#define BDEV_SECTOR_SIZE      512
    168 #define BDEV_IMAGE_NAME       "images.raw"
    169 
    170 #define NIC_RX_NAME           "giet_vm/nic/rx_packets.txt"
    171 #define NIC_TX_NAME           "giet_vm/nic/tx_packets.txt"
     192#define BDEV_IMAGE_NAME       PREFIX_OS"display/images.raw"
     193#endif
     194#ifdef USE_ALMOS
     195#define BDEV_SECTOR_SIZE      4096
     196#define BDEV_IMAGE_NAME       PREFIX_OS"hdd-img.bin"
     197#endif
     198
     199
     200#define NIC_RX_NAME           PREFIX_OS"nic/rx_packets.txt"
     201#define NIC_TX_NAME           PREFIX_OS"nic/tx_packets.txt"
    172202#define NIC_TIMEOUT           10000
    173203
     
    181211//////////////////////i/////////////////////////////////////
    182212
    183 #define SOFT_NAME             "soft.elf"
     213#ifdef USE_ALMOS
     214#define soft_name       PREFIX_OS"bootloader.bin",\
     215                        PREFIX_OS"kernel-soclib.bin@0xbfc10000:D",\
     216                        PREFIX_OS"arch-info.bib@0xBFC08000:D"
     217#endif
     218#ifdef USE_GIET
     219#define soft_pathname   PREFIX_OS"soft.elf"
     220#endif
    184221
    185222////////////////////////////////////////////////////////////
     
    203240
    204241#define FBUF_BASE       0x00B2000000     
    205 #define FBUF_SIZE       FBUF_X_SIZE * FBUF_Y_SIZE
     242#define FBUF_SIZE       FBUF_X_SIZE * FBUF_Y_SIZE * 2
    206243
    207244#define BDEV_BASE       0x00B3000000     
     
    247284   using namespace soclib::common;
    248285
    249 
    250    char     soft_name[256]   = SOFT_NAME;          // pathname to binary code
     286#ifdef USE_GIET
     287   char     soft_name[256]   = soft_pathname;      // pathname to binary code
     288#endif
    251289   uint64_t ncycles          = 100000000000;       // simulated cycles
    252290   char     disk_name[256]   = BDEV_IMAGE_NAME;    // pathname to the disk image
     
    261299   uint32_t frozen_cycles    = MAX_FROZEN_CYCLES;  // monitoring frozen processor
    262300   size_t   cluster_io_id    = 0;                  // index of cluster containing IOs
     301   struct   timeval t1,t2;
     302   uint64_t ms1,ms2;
    263303
    264304   ////////////// command line arguments //////////////////////
     
    273313         else if ((strcmp(argv[n],"-SOFT") == 0) && (n+1<argc) )
    274314         {
     315#ifdef USE_ALMOS
     316            assert( 0 && "Can't define almos soft name" );
     317#endif
     318#ifdef USE_GIET
    275319            strcpy(soft_name, argv[n+1]);
     320#endif
    276321         }
    277322         else if ((strcmp(argv[n],"-DISK") == 0) && (n+1<argc) )
     
    350395            "The NB_NIC_CHANNELS parameter must be smaller than 9" );
    351396
     397#ifdef USE_GIET
    352398    assert( (vci_address_width == 40) and
    353399            "VCI address width must be 40 bits" );
     400#endif
    354401
    355402    std::cout << std::endl;
     
    528575   ////////////////////////////
    529576
    530 #if USE_ALMOS
    531    soclib::common::Loader loader(almos_bootloader_pathname,
    532                                  almos_archinfo_pathname,
    533                                  almos_kernel_pathname);
    534 #else
    535577   soclib::common::Loader loader(soft_name);
    536 #endif
    537578
    538579   typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss;
     
    754795   signal_resetn = true;
    755796
     797   if (gettimeofday(&t1, NULL) != 0)
     798   {
     799      perror("gettimeofday");
     800      return EXIT_FAILURE;
     801   }
     802
    756803   for (uint64_t n = 1; n < ncycles; n++)
    757804   {
     
    759806      //clusters[0][0]->proc[0]->cache_monitor(0x800002c000ULL);
    760807      //clusters[1][0]->memc->copies_monitor(0x800002C000ULL);
     808
     809      if( (n % 5000000) == 0)
     810      {
     811
     812         if (gettimeofday(&t2, NULL) != 0)
     813         {
     814            perror("gettimeofday");
     815            return EXIT_FAILURE;
     816         }
     817
     818         ms1 = (uint64_t)t1.tv_sec * 1000ULL + (uint64_t)t1.tv_usec / 1000;
     819         ms2 = (uint64_t)t2.tv_sec * 1000ULL + (uint64_t)t2.tv_usec / 1000;
     820         std::cerr << "platform clock frequency " << (double)5000000 / (double)(ms2 - ms1) << "Khz" << std::endl;
     821
     822         if (gettimeofday(&t1, NULL) != 0)
     823         {
     824            perror("gettimeofday");
     825            return EXIT_FAILURE;
     826         }
     827      }
    761828
    762829      if (debug_ok and (n > debug_from) and (n % debug_period == 0))
Note: See TracChangeset for help on using the changeset viewer.