|
| 1 | +CAPI=2: |
| 2 | +# Copyright lowRISC contributors (OpenTitan project). |
| 3 | +# Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 4 | +# SPDX-License-Identifier: Apache-2.0 |
| 5 | +name: "lowrisc:dv:top_darjeeling_chip_verilator_sim:0.1" |
| 6 | +description: "Darjeeling toplevel for simulation with Verilator" |
| 7 | +virtual: |
| 8 | + - lowrisc:dv:chip_verilator_sim |
| 9 | + |
| 10 | +filesets: |
| 11 | + files_sim_verilator: |
| 12 | + depend: |
| 13 | + - lowrisc:dv_dpi_c:uartdpi |
| 14 | + - lowrisc:dv_dpi_sv:uartdpi |
| 15 | + - lowrisc:dv_dpi_c:gpiodpi |
| 16 | + - lowrisc:dv_dpi_sv:gpiodpi |
| 17 | + - lowrisc:dv_dpi_c:jtagdpi |
| 18 | + - lowrisc:dv_dpi_sv:jtagdpi |
| 19 | + - lowrisc:dv_dpi_c:dmidpi |
| 20 | + - lowrisc:dv_dpi_sv:dmidpi |
| 21 | + - lowrisc:dv_dpi_c:spidpi |
| 22 | + - lowrisc:dv_dpi_sv:spidpi |
| 23 | + - lowrisc:dv_verilator:memutil_verilator |
| 24 | + - lowrisc:dv_verilator:simutil_verilator |
| 25 | + - lowrisc:dv:sim_sram |
| 26 | + - lowrisc:dv:sw_test_status |
| 27 | + - lowrisc:dv:dv_test_status |
| 28 | + - lowrisc:systems:chip_darjeeling_verilator |
| 29 | + files: |
| 30 | + - chip_sim_tb.sv: { file_type: systemVerilogSource } |
| 31 | + - chip_sim_tb.cc: { file_type: cppSource } |
| 32 | + |
| 33 | +parameters: |
| 34 | + RVFI: |
| 35 | + datatype: bool |
| 36 | + paramtype: vlogdefine |
| 37 | + description: Enable the RISC-V Verification Interface and instruction tracing |
| 38 | + VERILATOR_MEM_BASE: |
| 39 | + datatype: int |
| 40 | + paramtype: vlogdefine |
| 41 | + description: Main memory mem base. |
| 42 | + VERILATOR_TEST_STATUS_ADDR: |
| 43 | + datatype: int |
| 44 | + paramtype: vlogdefine |
| 45 | + description: Verilator specific address to write to, to report the test status. This value should be at a word offset in the unmapped address space. |
| 46 | + rom0init: |
| 47 | + datatype : file |
| 48 | + description : Application to load into Base ROM (in Verilog hex format) |
| 49 | + paramtype : cmdlinearg |
| 50 | + rom1init: |
| 51 | + datatype : file |
| 52 | + description : Application to load into Second ROM (in Verilog hex format) |
| 53 | + paramtype : cmdlinearg |
| 54 | + otpinit: |
| 55 | + datatype : file |
| 56 | + description : Image to load into the OTP (in Verilog hex format) |
| 57 | + paramtype : cmdlinearg |
| 58 | + ctnraminit: |
| 59 | + datatype : file |
| 60 | + description : Application to load into CTN RAM (in Verilog hex format) |
| 61 | + paramtype : cmdlinearg |
| 62 | + DMIDirectTAP: |
| 63 | + datatype: bool |
| 64 | + paramtype: vlogdefine |
| 65 | + default: true |
| 66 | + description: Replace JTAG TAP with an OpenOCD direct connection |
| 67 | + UART_LOG_uart0: |
| 68 | + datatype: str |
| 69 | + paramtype: plusarg |
| 70 | + description: Write a log of output from uart0 to the given log file. Use "-" for stdout. |
| 71 | + RV_CORE_IBEX_SIM_SRAM: |
| 72 | + datatype: bool |
| 73 | + paramtype: vlogdefine |
| 74 | + description: Disconnect the TL data output of rv_core_ibex so that we can attach the simulation SRAM. |
| 75 | + |
| 76 | +targets: |
| 77 | + default: &default_target |
| 78 | + filesets: |
| 79 | + - files_sim_verilator |
| 80 | + toplevel: chip_sim_tb |
| 81 | + |
| 82 | + sim: |
| 83 | + parameters: |
| 84 | + - RVFI=true |
| 85 | + - VERILATOR_MEM_BASE=0x10000000 |
| 86 | + - VERILATOR_TEST_STATUS_ADDR=0x211f0440 |
| 87 | + - rom0init |
| 88 | + - rom1init |
| 89 | + - otpinit |
| 90 | + - ctnraminit |
| 91 | + - DMIDirectTAP |
| 92 | + - RV_CORE_IBEX_SIM_SRAM=true |
| 93 | + default_tool: verilator |
| 94 | + filesets: |
| 95 | + - files_sim_verilator |
| 96 | + toplevel: chip_sim_tb |
| 97 | + tools: |
| 98 | + verilator: |
| 99 | + mode: cc |
| 100 | + verilator_options: |
| 101 | + # Disabling tracing reduces compile times but doesn't have a |
| 102 | + # huge influence on runtime performance. |
| 103 | + - '--trace' |
| 104 | + - '--trace-fst' # this requires -DVM_TRACE_FMT_FST in CFLAGS below! |
| 105 | + # Remove FST options for VCD trace |
| 106 | + - '--trace-structs' |
| 107 | + - '--trace-params' |
| 108 | + - '--trace-max-array 1024' |
| 109 | + - '--unroll-count 512' |
| 110 | + # TODO: Variable expansion depends on edalize internals. Find better solution. |
| 111 | + # (Applies to LDFLAGS expansion below as well) |
| 112 | + - '-CFLAGS "$(CFLAGS_FOR_BUILD) -std=c++17 -Wall -DVM_TRACE_FMT_FST -DVL_USER_STOP -DTOPLEVEL_NAME=chip_sim_tb"' |
| 113 | + - '-LDFLAGS "$(LDFLAGS_FOR_BUILD) -pthread -lutil -lelf"' |
| 114 | + - '-Wall' |
| 115 | + # Execute simulation with four threads by default, which works best |
| 116 | + # with four physical CPU cores. |
| 117 | + # Users can override this setting by appending e.g. |
| 118 | + # --verilator_options '--threads 2' |
| 119 | + # to the end of the fusesoc invocation when compiling the simulation. |
| 120 | + - '--threads 4' |
| 121 | + # XXX: Cleanup all warnings and remove this option |
| 122 | + # (or make it more fine-grained at least) |
| 123 | + - '-Wno-fatal' |
| 124 | + |
| 125 | + lint: |
| 126 | + <<: *default_target |
| 127 | + default_tool: verilator |
| 128 | + tools: |
| 129 | + verilator: |
| 130 | + mode: lint-only |
| 131 | + verilator_options: |
| 132 | + - "-Wall" |
0 commit comments