SiFive VIC - E24 User Guide
SiFive VIC - E24 User Guide
© SiFive, Inc.
SiFive VIC_E24 User Guide
Proprietary Notice
SiFive expressly disclaims all warranties, representations, and conditions of any kind, whether
express or implied, including, but not limited to, the implied warranties or conditions of mer-
chantability, fitness for a particular purpose and non-infringement.
SiFive does not assume any liability rising out of the application or use of any product or circuit,
and specifically disclaims any and all liability, including without limitation indirect, incidental, spe-
cial, exemplary, or consequential damages.
SiFive reserves the right to make changes without further notice to any products herein.
Contents
1 Introduction .............................................................................................................. 3
1.1 About this Document ................................................................................................... 3
1.2 About this Release ...................................................................................................... 3
2 Deliverables .............................................................................................................. 4
2.1 Folder Structure .......................................................................................................... 4
3 Memories .................................................................................................................... 6
3.1 RAM Instances ........................................................................................................... 6
1
2
7 Debug Interface..................................................................................................... 18
7.1 JTAG TAPC State Machine ........................................................................................ 19
7.2 Resetting JTAG Logic ................................................................................................ 19
7.3 JTAG Clocking .......................................................................................................... 20
7.4 JTAG Standard Instructions ....................................................................................... 20
7.5 JTAG Debug Commands ........................................................................................... 20
7.6 Using Debug Outputs ................................................................................................ 20
8 Implementation ..................................................................................................... 21
8.1 Top Level ................................................................................................................. 21
8.2 Clocking ................................................................................................................... 21
8.2.1 Clocking Guidelines .......................................................................................... 22
8.3 Retiming .................................................................................................................. 22
8.4 Gate Level Simulation ............................................................................................... 22
Introduction
3
Chapter 2
Deliverables
This chapter describes the contents of the deliverables for the VIC_E24 .
arty_a7_100t-sifive
Contains the designs FPGA bitstream.
freedom-e-sdk
Software SDK for the design including Freedom Metal BSP and applications.
bsp
Freedom Metal BSP for the RTL testbench and, where applicable, the FPGA bit-
stream. Note that Freedom Metal BSPs also include a design’s Device Tree file (DTS).
freedom-devicetree-tools
Tools used to generate Freedom Metal BSPs from DTS files. Can be used to re-gener-
ate BSPs in the case of a hand-edited DTS file.
freedom-metal
Source code for the Freedom Metal library.
scripts
Helper scripts used by the main makefile.
software
One folder for each included Freedom Metal application. Each application includes a
pre-built hex file in its release directory which can be run directly on the testbench with-
out needed to re-compile from source. Note: In some cases there will not be a pre-built
hex file for every application. This will be the case when a particular application is not
expected to run correctly on the selected core configuration. Possible reasons for this
are:
4
Copyright © 2019, SiFive Inc. All rights reserved. 5
Makefile
Top-level SDK makefile which can be used to re-build all included examples from
source. Readme.md; Readme file describing how to use the SDK’s top-level makefile.
info
Files which describe the design.
mems.conf
Configuration file which describes the memory instances of the design.
modules_to_be_retimed.txt
Contains the list of modules which need to be retimed.
sifive_insight.yml
Contains a .yml description of the SiFive Insight signals included in the design. See
Section 9.3 for more details on SiFive Insight.
rtl
The VIC_E24 RTL.
memories
A single verilog file containing all memories in the design.
testbench
Includes all the modules in the synthesizable testbench, the test driver, and extracted
simulation constructs (assertions) that are bound to locations in the DUT.
design
The VIC_E24 itself. Includes the top-level module E2_CoreIPSubsystem and all sub-
modules.
sifive_insight
Contains all the System Verilog files defining and binding the SiFive Insight signals to
modules in the design.
.F files
Manifest files for the associated folder. A complete list of files to be synthesized as part
of the design can be found in design.F.
Makefile
Used to execute the test bench described in Chapter 9.
Chapter 3
Memories
Behavioral models of the RAMS are provided as part of the deliverable in the file: verilog/
memories/CoreIPSubsystem*.
The VIC_E24 RAM instances are delivered as is and are not configurable. It is, however, possi-
ble to possible construct the memory instances from multiple smaller instances.
Module Name Depth Address Data Width Write Mask Granu- Description
Width ( ) ( ) larity ( )
instr_mem_ext 4096 12 32 32 ICache
Data Array
syssram0_ext 8192 13 32 8 sys-sram-0
syssram0_ext 8192 13 32 8 sys-sram-1
tag_mem_ext 512 9 18 18 ICache Tag
Array
Table 1: SRAM Modules and Configuration
6
Copyright © 2019, SiFive Inc. All rights reserved. 7
VIC_E24 Interfaces
8
Copyright © 2019, SiFive Inc. All rights reserved. 9
4.2 Ports
This section will describe all of the Ports in the VIC_E24.
The VIC_E24 System Port pass through a TileLink to AHB Bridge (TL2AHB) which is described
in Chapter 6.
This chapter describes how the VIC_E24 handles errors from its memories and interfaces.
Errors can be introduced to the core via ECC errors or error responses returned on the various
port interfaces. For port interfaces that are not natively TileLink, their error responses are trans-
lated into TileLink errors as described in the respective bridge chapters. The core’s behavior is
purely determined by the type of TileLink or ECC error that it receives. The behavior is also
dependent on the type of core.
Note that 2-series TIMs are TileLink devices within the Core Complex boundary, so errors in
those structures present TileLink errors to the core the same as devices outside the boundary.
11
Chapter 6
6.1 Introduction
SiFive’s TileLink to AHB Bridge (TL2AHB) can be used to connect SiFive Core Complex IP to
AMBA 3 AHB Protocol v1.0 based systems. SiFive Core Complex IP natively uses TileLink for
all system communication external to the Core Complex. The TL2AHB bridge translates TileLink
transactions to AMBA 3 AHB Protocol v1.0.
6.2 Compliance
• The SiFive TL2AHB is fully compliant with AMBA 3 AHB Protocol v1.0 and this document
should be read in conjunction with the AMBA 3 AHB Protocol v1.0 Protocol Specification.
• The SiFive TL2AHB is fully compatible with SiFive Core Complex IP. Some properties of the
TL2AHB are specific to a given Core Complex implementation. This document should be
read in conjunction with the Core Complex IP Manual.
12
Copyright © 2019, SiFive Inc. All rights reserved. 13
6.5.2 Bursts
• The TL2AHB will fragment a TileLink burst transaction to the largest supported AHB burst
size
• Request are always aligned to the burst size.
Copyright © 2019, SiFive Inc. All rights reserved. 15
• Only fixed size incrementing or single beat burst are issued, specifically:
◦ SINGLE
◦ INCR4
◦ INCR8
◦ INCR16
• Multi-beat narrow burst are never issued.
HADDR
• For a given Core Complex implementation, the width of HADDR is the minimum width nec-
essary for the the address range of the TileLink bus it is connected to.
HMASTLOCK
• HMASTLOCK is always tied to 0.
HPROT
• HPROT is tied to 0x3: Non-cacheable, Non-bufferable, privileged, data access.
HSEL
• A single HSEL bit is implemented and used to indicate when the port is active.
• An external arbiter and decoder is required to select more than one slave device. See Sec-
tion 6.5.3.
HRESP
• When HRESP indicates a transfer error, the signal is translated into the TileLink response
d_error. OKAY = LOW.
Debug Interface
The SiFive VIC_E24 includes the JTAG debug transport module (DTM) described in The
RISC‑V Debug Specification, Version 0.13. This enables a single external industry-standard
1149.1 JTAG interface to test and debug the system. The JTAG interface can be directly con-
18
Copyright © 2019, SiFive Inc. All rights reserved. 19
On-chip JTAG connections must be driven (no pullups), with a normal 2-state driver for TDO
under the expectation that on-chip mux logic will be used to select between alternate on-chip
JTAG controllers' TDO outputs. TDO logic changes on the falling edge of TCK.
Asserting jtag_reset resets both the JTAG DTM and debug module test logic. Because parts
of the debug logic require synchronous reset, the jtag_reset signal is synchronized inside the
VIC_E24.
During operation, the JTAG DTM logic can also be reset without jtag_reset by issuing 5
jtag_TCK clock ticks with jtag_TMS asserted. This action resets only the JTAG DTM, not the
debug module.
The Manufacturer ID field of IDCODE is provided by the RISC-V Core IP integrator, on the
jtag_mfr_id input.
The debug scan register includes a 2-bit opcode field, a 7-bit debug module address field, and a
32-bit data field.
to allow various memory-mapped read/write operations to be specified with a single scan of the
debug scan register.
Implementation
All top level interfaces are described in the the VIC_E24 Chapter 4.
8.2 Clocking
The VIC_E24 has the following main clock inputs: clock, rtc_toggle. clock is used to clock
the bus, PLIC and debug interfaces. rtc_toggle is exposed via the architectually defined real
time counter exposed in the mtime CSR.
21
Copyright © 2019, SiFive Inc. All rights reserved. 22
8.3 Retiming
A list of all modules (if any) which require retiming is included in the design deliverables. The list
can be found in the info/retiming_modules.txt file.
For Synopsys Design Compiler and IC Compiler, the command all_registers -output_pins
can be used to enumerate all state elements in the design. The UCLI command force
Copyright © 2019, SiFive Inc. All rights reserved. 23
-deposit <inst> <value> can be used in VCS simulation to force the output pins to 0 or 1.
VCS also requires a PLI table file to enable wn capability (debug access) on these instances.
Note that if the standard cell logic library contains flip-flops with inverted outputs (i.e., Q and
QN), those pins must be initialized to opposite values.
Chapter 9
Simulation Testbench
For more information on the Freedom E SDK environment, please read the readme file located
in the freedom-e-sdk directory.
24
Copyright © 2019, SiFive Inc. All rights reserved. 25
make all-waves
will run all of the tests in the tests folder and produce the resulting <test_name>.out and
<test_name>.vpd files which can then be analyzed for detailed execution information.
Format:
core id: cycle [valid] pc=[address] Written[register=value][valid]
Read[register=value] Read[register=value]
Example:
C0: 483 [1] pc=[00000002138] W[r 3=000000007fff7fff][1] R[r 1=000000007fffffff] R[r
2=ffffffffffff8000]
C0: 484 [1] pc=[0000000213c] W[r29=000000007fff8000][1] R[r31=ffffffff80007ffe]
R[r31=0000000000000005]
C0: 485 [0] pc=[00000002140] W[r 0=0000000000000000][0] R[r 0=0000000000000000] R[r
0=0000000000000000]
The first [1] at cycle 483, core 0, shows that there’s a valid instruction at PC 0x2138 in the
writeback stage. The second [1] tells us that the register file is writing r3 with the corresponding
value 0x7fff7fff. When the add instruction was in the decode stage, the pipeline had read r1
and r2 with the corresponding values next to it. Similarly at cycle 484, there’s a valid instruction
at PC 0x213c in the writeback stage. At cycle 485, there isn’t a valid instruction in the writeback
stage, perhaps, because of a instruction cache miss at PC 0x2140.
• In the freedom-e-sdk/software directory, make a copy of the return-pass folder and name the
copied folder to the name of your test. For this example we will use $TEST.
• In the $TEST directory, edit the makefile variable PROGRAM to match the name $TEST.
• In the $TEST directory, change the filename of return-pass.c to $TEST.c
• Use the Freedom E SDK makefile to build the test targeting the RTL BSP and the release
Configuration. The name of your BSP can be found in the freedom-e-sdk/bsp directory.
• In the base directory of the deliverable, it is now possible to run the new test using the test-
bench makefile.
make $TEST.out
For more information on using Freedom E SDK and its environment, please read the readme
file located in the freedom-e-sdk directory.
Note that some signals in SiFive Insight are pseudo-signals which represent several signals with
logic applied to them in order to present a more useful higher-level function. For example, the
Instruction Commit signal in a design may be the logical combination of several signals.
SiFive Insight also manages the grouping of signals to improve readability. An example of this
would be how SiFive Insight presents the mstatus CSR. SiFive Insight presents mstatus such
that each field in the CSR is grouped together, improving readability directly from the waveform
viewer.
A complete list of SiFive Insight signals, along with descriptions, can be found in the info/
sifive_insight.yml file located in the deliverables.
Copyright © 2019, SiFive Inc. All rights reserved. 27
Once the test completes, open the VPD wave file with a waveform viewer such as Synopsys
DVE. The SiFive Insight module can be found under the Verilog module hierarchy TestDriver/
testHarness/system/SiFive_Insight or by simply searching for SiFive_Insight.
From here it is possible to add the SiFive Insight signals to the waveform viewer.