Skip to content

Commit

Permalink
[#64890] Add VCS support
Browse files Browse the repository at this point in the history
  • Loading branch information
JanOlencki committed Sep 24, 2024
1 parent c18df45 commit dda1be2
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cmake/build-cosimulation.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ else()
verilate(verilated SOURCES ${FINAL_SIM_FILES} TOP_MODULE ${SIM_TOP} PREFIX "V${SIM_TOP}" VERILATOR_ARGS ${FINAL_VERILATOR_ARGS})
endif()

###
### DPI Library
###
add_library(renode_dpi SHARED ${RENODE_SOURCES})

###
### Prepare Questa target
###
Expand Down Expand Up @@ -208,3 +213,23 @@ else()
)
add_custom_target(questa-build ALL DEPENDS questa_optimized)
endif()

###
### Prepare VCS target
###
set(USER_VCS_PATH CACHE STRING "Path to VCS bin directory")
find_program(VCS_COMMAND vcs ${USER_VCS_PATH})

set(USER_VCS_ARGS ${VCS_ARGS} CACHE STRING "Extra arguments/switches used for build and run Questa commands (vlog, vopt, vsim)")
separate_arguments(USER_VCS_ARGS)
set(FINAL_VCS_ARGS ${USER_VCS_ARGS})
list(APPEND FINAL_VCS_ARGS ${FINAL_GENERIC_ARGUMENTS})
if(NOT VCS_COMMAND)
message(NOTICE "There's no VCS available. This target will be ignored.")
else()
add_custom_command(OUTPUT vcs_simulation_executable
COMMAND ${VCS_COMMAND} -full64 -sverilog ${FINAL_VCS_ARGS} ${FINAL_SIM_FILES}
)
add_custom_target(vcs-build ALL DEPENDS vcs_simulation_executable)
add_dependencies(vcs-build renode_dpi)
endif()
8 changes: 8 additions & 0 deletions robot/dpi-keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ ${BUILD_DIRECTORY} ./build

${VERILATOR_SIMULATION} ${BUILD_DIRECTORY}/verilated

${VCS_SIMULATION} ${BUILD_DIRECTORY}/simv
@{VCS_ARGUMENTS} -sv_lib ${BUILD_DIRECTORY}/librenode_dpi

${QUESTA_SIMULATION} vsim
@{QUESTA_ARGUMENTS} design_optimized
... -work ${BUILD_DIRECTORY}/work_questa
Expand Down Expand Up @@ -38,6 +41,11 @@ Get Connection Plus Args
... +RENODE_ADDRESS\=${parameters}[2]
RETURN ${arguments}

Run VCS
[Arguments] ${additional_arguments}
${arguments}= Combine Lists ${VCS_ARGUMENTS} ${additional_arguments}
Run Executable ${VCS_SIMULATION} ${arguments}

Run Verilator
[Arguments] ${arguments}
Run Executable ${VERILATOR_SIMULATION} ${arguments}
Expand Down
6 changes: 6 additions & 0 deletions samples/ahb_dma/tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${DMA_PERIPHERAL} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${DMA_PERIPHERAL} Create Machine Run VCS

Should Run DMA In Verilator
[Tags] verilator
Expand All @@ -117,3 +120,6 @@ Should Run DMA In Questa
[Tags] questa
Should Run DMA ${DMA_PERIPHERAL} Run Questa

Should Run DMA In VCS
[Tags] vcs
Should Run DMA ${DMA_PERIPHERAL} Run VCS
9 changes: 9 additions & 0 deletions samples/ahb_mem/tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${MEMORY_PERIPHERAL} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${MEMORY_PERIPHERAL} Create Machine Run VCS

Should Read And Write Memory In Verilator
[Tags] verilator
Expand All @@ -69,6 +72,9 @@ Should Read And Write Memory In Questa
[Tags] questa
Should Connect, Read And Write ${MEMORY_PERIPHERAL} Run Questa

Should Read And Write Memory In VCS
[Tags] vcs
Should Connect, Read And Write ${MEMORY_PERIPHERAL} Run VCS

Should Return Zero on Invalid Access In Verilator
[Tags] verilator
Expand All @@ -78,3 +84,6 @@ Should Return Zero on Invalid Access In Questa
[Tags] questa
Should Return Zero on Invalid Access ${MEMORY_PERIPHERAL} Run Questa

Should Return Zero on Invalid Access In VCS
[Tags] vcs
Should Return Zero on Invalid Access ${MEMORY_PERIPHERAL} Run VCS
6 changes: 6 additions & 0 deletions samples/ahb_simple_manager/tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${SUBORDINATE_PERIPHERAL} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${SUBORDINATE_PERIPHERAL} Create Machine Run VCS

Should Run Subordinate In Verilator
[Tags] verilator
Expand All @@ -45,3 +48,6 @@ Should Run Subordinate In Questa
[Tags] questa
Should Run Subordinate ${SUBORDINATE_PERIPHERAL} Run Questa

Should Run Subordinate In VCS
[Tags] vcs
Should Run Subordinate ${SUBORDINATE_PERIPHERAL} Run VCS
6 changes: 6 additions & 0 deletions samples/apb3_completer_mem/tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${DUT} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${DUT} Create Machine Run VCS

Should Read And Write Memory In Verilator
[Tags] verilator
Expand All @@ -61,3 +64,6 @@ Should Read And Write Memory In Questa
[Tags] questa
Should Connect, Read And Write ${DUT} Run Questa

Should Read And Write Memory In VCS
[Tags] vcs
Should Connect, Read And Write ${DUT} Run VCS
6 changes: 6 additions & 0 deletions samples/apb3_requester_synth/tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${DUT} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${DUT} Create Machine Run VCS

Should Read And Write Memory In Verilator
[Tags] verilator
Expand All @@ -84,3 +87,6 @@ Should Read And Write Memory In Questa
[Tags] questa
Should Read And Write Memory ${DUT} Run Questa

Should Read And Write Memory In VCS
[Tags] vcs
Should Read And Write Memory ${DUT} Run VCS
12 changes: 12 additions & 0 deletions samples/axi_fastvdma/test_basic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${DMA_PERIPHERAL} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${DMA_PERIPHERAL} Create Machine Run VCS

Should Write DMA Registers In Verilator
[Tags] verilator
Expand All @@ -141,6 +144,9 @@ Should Write DMA Registers In Questa
[Tags] questa
Should Write DMA Registers ${DMA_PERIPHERAL} Run Questa

Should Write DMA Registers In VCS
[Tags] vcs
Should Write DMA Registers ${DMA_PERIPHERAL} Run VCS

Should Run DMA Transaction In Verilator
[Tags] verilator
Expand All @@ -150,6 +156,9 @@ Should Run DMA Transaction In Questa
[Tags] questa
Should Run DMA Transaction ${DMA_PERIPHERAL} Run Questa

Should Run DMA Transaction In VCS
[Tags] vcs
Should Run DMA Transaction ${DMA_PERIPHERAL} Run VCS

Should Trigger DMA Interrupt In Verilator
[Tags] verilator
Expand All @@ -159,3 +168,6 @@ Should Trigger DMA Interrupt In Questa
[Tags] questa
Should Trigger DMA Interrupt ${DMA_PERIPHERAL} Run Questa

Should Trigger DMA Interrupt In VCS
[Tags] vcs
Should Trigger DMA Interrupt ${DMA_PERIPHERAL} Run VCS
3 changes: 3 additions & 0 deletions samples/axi_fastvdma/test_linux.robot
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ Should Boot Linux And User DMA In Questa
[Tags] questa
Should Boot Linux And User DMA ${DMA_PERIHPERAL} Run Questa

Should Boot Linux And User DMA In VCS
[Tags] vcs
Should Boot Linux And User DMA ${DMA_PERIHPERAL} Run VCS
6 changes: 6 additions & 0 deletions samples/axi_ram/tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${MEMORY_PERIPHERAL} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${MEMORY_PERIPHERAL} Create Machine Run VCS

Should Read And Write Memory In Verilator
[Tags] verilator
Expand All @@ -62,3 +65,6 @@ Should Read And Write Memory In Questa
[Tags] questa
Should Connect, Read And Write ${MEMORY_PERIPHERAL} Run Questa

Should Read And Write Memory In VCS
[Tags] vcs
Should Connect, Read And Write ${MEMORY_PERIPHERAL} Run VCS
7 changes: 7 additions & 0 deletions samples/gpio_repeater/tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Should Connect Questa
[Tags] questa
Should Connect To Simulation And Reset Peripheral ${REPEATER_PERIPHERAL} Create Machine Run Questa

Should Connect VCS
[Tags] vcs
Should Connect To Simulation And Reset Peripheral ${REPEATER_PERIPHERAL} Create Machine Run VCS

Should Repeat GPIO Signal In Verilator
[Tags] verilator
Should Repeat GPIO Signal ${REPEATER_PERIPHERAL} Run Verilator
Expand All @@ -60,3 +64,6 @@ Should Repeat GPIO Signal In Questa
[Tags] questa
Should Repeat GPIO Signal ${REPEATER_PERIPHERAL} Run Questa

Should Repeat GPIO Signal In VCS
[Tags] vcs
Should Repeat GPIO Signal ${REPEATER_PERIPHERAL} Run VCS

0 comments on commit dda1be2

Please sign in to comment.