User Tools

Site Tools


sopc_to_qsys

Running LegUp with QSYS or SOPC

parameter in makefile.config specifies which builder to use for makefile.common

  BUILDER = SOPC / QSYS

parameter in legup.tcl specifies builder to use for SwOnly.cpp

  set_parameter USE_QSYS 0

0 for SOPC, 1 for QSYS

Implementing LegUp to run with Qsys

Files changed

Makefile.config

added parameter “BUILDER” to specify which software to use (SOPC builder or QSYS)

Makefile.common

hybridGenerateSOPC: added scripts to generate qsys system and testbench

clean: cleantiger cleanpcie added legup_qsys.tcl to files to remove

legup.tcl

added parameter USE_QSYS set to 0 for SOPC, 1 for QSYS

tiger_top_hw.tcl

for QSYS, changed (in 3 places)

  associatedReset reset

SwOnly.cpp

Directory:

  ~/legup-3.0/llvm/lib/Transforms/LegUp/SwOnly.cpp

Functions Added

  void printQSYSFileInitial(raw_ostream &qsys);
  void printQSYSFileAPIcores(raw_ostream &qsys);
  void printQSYSFile(raw_ostream &qsys, Function * F, unsigned long long baseAddr, int AccelCount);

tcl file changes

  void printCacheHWtcl()
  void SwOnly::initWaveFile(...)

added if statement to distinguish btw sopc and qsys

data_cache_hw.tcl: qsys system changed bursts to pipelined

wave.do: qsys testbench uses different instance naming scheme

sopc/qsys tcl script

sopc module = qsys instance

add module/instance:

in sopc

  add_module type module_name
  Ex. add_module data_cache data_cache_0

equivalent to qsys

  add_instance instance_name type
  Ex. add_instance data_cache_0 data_cache

setting base address:

in sopc

  set_avalon_base_address instance.interface "0x0" 

equivalent to qsys

  set_connection_parameter_value instance_0.interface_0/instance_1.interface_1 baseAddress "0x0"

Notes:

  • baseAddress can be set to desired value, not necessarily 0x0 (this is used here for simplicity)
  • instance_0.interface_0 and instance_1.interface_1 indicate the two connection points for which the baseAddress is set
    • For example, from example 'matrixmultiply' in 'legup-3.0/examples/matrixmultiply'
    • change

set_avalon_base_address multiply_0.s1 “0x0”

  • to

set_connection_parameter_value pipeline_bridge_PERIPHERALS.m0/multiply_0.s1 baseAddress “0x0”

need to add for every instance:

  add_connection clk.clk_reset instance.clockreset_reset

to load a system

need to first have tiger.qsys in the tiger sub-directory

  load_system tiger/tiger.qsys

to save a system

  save_system

saves system to the same file that was opened with 'load_system'

  save_system file_name.qsys

saves system to the name specified here Note: must save system to a .qsys file, otherwise will cause Error

generating a system

Do not need 'generate_system' in the tcl file, as was needed for sopc. The 'ip-generate' script in Makefile.common will run the tcl script through qsys and generate the .v file

others

for all instances of:

  pipeline_bridge_PARAMETER.x1

change to:

  pipeline_bridge_PARAMETER.x0

(change 1's to 0's)

Simulation

Testbench top level module

  ./tiger/testbench/tiger_tb/simulation/tiger_tb.v

all other files in

  ./tiger/testbench/tiger_tb/simulation/submodules

qsys generated testbench uses system verilog files, need to have full version of Modelsim to run simulation

Significant Changes

QSYS uses QuartusII 13.0 instead of 11.1 SOPC still supported. tiger processor directory:

  legup-3.0/tiger/processor/tiger_DEx_sopc

QSYS system changed burst to pipelined

sopc_to_qsys.txt · Last modified: 2013/06/24 14:28 by emily.miao