Skip to content

Using and Compiling OpenSoC Fabric

Farzad Fatollahi-Fard edited this page Nov 16, 2016 · 5 revisions

Using and Compiling OpenSoC Fabric

OpenSoC Fabric can be cloned from our Github page. OpenSoC Fabric and Chisel require sbt to run. Once sbt is installed you can navigate to the root folder in the OpenSoC Fabric git repository. By default, OpenSoC Fabric is configured to a 2x2 Mesh Network with virtual channel routing and a concentration of 1. To run a simple random flit injection test with a 100% injection rate simply execute the following command in that folder:

$ sbt "run --sw true --harnessName OpenSoC_CMeshTester_Random_VarInjRate --moduleName OpenSoC_CMesh_Flit"

By default, OpenSoC Fabric will build the C++ model of the network for simulation on your local machine. Depending on the speed of your machine this test should complete in about a minute. Once complete, you will find a .vcd file in the root folder that is viewable with any VCD viewer (such as Scansion or GTKwave.) If you would prefer a Verilog model rather than the C++ model, then changing the --sw command line flag to --hw will build a Verilog model of your network rather than the C++ model.

Currently we have the following tests available:

  • Random Flit with variable injection rate: This test will inject flits with a random destination at a controlled injection rate set by the command line argument --injRate <Rate> where Rate is an integer representing the desired injection rate percentage. An example of this test with a 50% injection rate is:
$ sbt "run --sw true --harnessName OpenSoC_CMeshTester_Random_VarInjRate --moduleName OpenSoC_CMesh_Flit --injRate 50"
  • Neighbor Pattern with variable injection rate: This test will inject flits with a neighboring router as a destination at a controlled injection rate set by the command line argument --injRate <Rate> where Rate is an integer representing the desired injection rate percentage. An example of this test with a 50% injection rate is:
$ sbt "run --sw true --harnessName OpenSoC_CMesh_NeighborTester_VarInjRate --moduleName OpenSoC_CMesh_Flit --injRate 50"
  • Tornado Pattern with variable injection rate: This test will inject flits using the tornado test pattern and using an injection rate set by the command line argument --injRate <Rate> where Rate is an integer representing the desired injection rate percentage. An example of this test with a 50% injection rate is:
$ sbt "run --sw true --harnessName OpenSoC_CMesh_TornadoTester_VarInjRate --moduleName OpenSoC_CMesh_Flit --injRate 50"
  • Bitreverse Pattern with variable injection rate: This test will inject flits using the Bit Reverse test pattern and using an injection rate set by the command line argument --injRate <Rate> where Rate is an integer representing the desired injection rate percentage. An example of this test with a 50% injection rate is:
$ sbt "run --sw true --harnessName OpenSoC_CMesh_BitReverseTester_VarInjRate --moduleName OpenSoC_CMesh_Flit --injRate 50"
  • Transpose Pattern with variable injection rate: This test will inject flits using the Transpose test pattern and using an injection rate set by the command line argument --injRate <Rate> where Rate is an integer representing the desired injection rate percentage. An example of this test with a 50% injection rate is:
$ sbt "run --sw true --harnessName OpenSoC_CMesh_TransposeTester_VarInjRate --moduleName OpenSoC_CMesh_Flit --injRate 50"
  • Random Packet with 100% injection rate: This test demonstrates OpenSoC's use of packets versus flits and will inject packets into the network with a random destination. This test will drive all network ports to saturation. The command line below will run this test:
$ sbt "run --sw true --harnessName OpenSoC_CMeshTester_Random_Packet --moduleName OpenSoC_CMesh"

The following is a list of all valid command line arguments:

Argument Description
--Dim N Dimension of the network (N > 1)
--K X,Y,... Size of the network in each dimension (X,Y,... > 1)
--C N Concentration of each network port (N > 0)
--numVCs N Number of Virtual Channels in the network (N > 1)
--hw true Generate Verilog (DO NOT USE WITH SW FLAG)
--sw true Generate C++ (DO NOT USE WITH HW FLAG)
--moduleName NAME Module of the network to run/generate
--harnessName NAME Test harness to run for a given module
--injRate N SW Only: Injection rate of packet insertion (N is between 0-100)
--packetCount N SW Only: Number of packets to inject per network port (N > 1)

Statistics Collected From Tests

All of the above tests will generate three .csv files in the root folder: channelUtilOut.csv, latency.csv, and routerUtilOut.csv. These values can be plotted using the included statPlot.py; you will need to have numPy installed. Example output plots of flit latencies and router utilization are shown below. Latencies are collected within the tester while router utilization is collected through the use of a probe hardware/src/main/scala/busprobe.scala which monitors channel and router utilization.

Example Router Utilization Example Packet Latencies
Example Router Utilization Example Packet Latencies

If you would like to add additional tests, or your own modules, you can specify these on the command line by adding your test and/or module to hardware/src/main/scala/main.scala. You will find two switch statements which create a modules and test harnesses. You will need to edit these statements to include your module or test harness. The text string in each case statement much match exactly the harnessName or moduleName argument passed in on the command line.