Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 548d79c

Browse files
committed
Modify E300 to X300
Modifications: - Increase clock to 65 MHz - Enable user mode - Increase HW breakpoints to 8 - Add 2 perf counters, hpmcounter3 and hpmcounter4 - Add Xilinx EthernetLite core for Arty - Make icache 4-way set associative - Map ITIM at 0x0800_0000 - Expand DTIM to 64k - Add 3 local interrupts and map GPIO BTN0-BTN2 to them - Add temporary PMOD JA remaps for robotic arm
1 parent d9c270a commit 548d79c

File tree

15 files changed

+637
-99
lines changed

15 files changed

+637
-99
lines changed

Makefile.x300artydevkit

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# See LICENSE for license details.
2+
# Modifications copyright (C) 2019 Hex-Five
23
base_dir := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
3-
BUILD_DIR := $(base_dir)/builds/e300artydevkit
4+
BUILD_DIR := $(base_dir)/builds/x300artydevkit
45
FPGA_DIR := $(base_dir)/fpga-shells/xilinx
5-
MODEL := E300ArtyDevKitFPGAChip
6-
PROJECT := sifive.freedom.everywhere.e300artydevkit
7-
export CONFIG_PROJECT := sifive.freedom.everywhere.e300artydevkit
8-
export CONFIG := E300ArtyDevKitConfig
6+
MODEL := X300ArtyDevKitFPGAChip
7+
PROJECT := hexfive.x300artydevkit
8+
export CONFIG_PROJECT := hexfive.x300artydevkit
9+
export CONFIG := X300ArtyDevKitConfig
910
export BOARD := arty
1011
export BOOTROM_DIR := $(base_dir)/bootrom/xip
1112

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# X300
2+
3+
This repository contains the X300, a modified version of [SiFive's Freedom E300
4+
Platform](https://github.com/sifive/freedom/tree/3624efff1819e52cec30c72f9085158189f8b53f)
5+
to support [MultiZone](https://hex-five.com/products/) and IoT applications.
6+
Here's a comparison between the E300 and the X300:
7+
8+
| E300 | X300 |
9+
| ---------------- | -------------------------------------------- |
10+
| RV32ACIM | RV32ACIMU |
11+
| 32.5 MHz clock | 65 MHz clock |
12+
| 2 HW breakpoints | 8 HW breakpoints |
13+
| no Ethernet core | Xilinx EthernetLite Ethernet core |
14+
| 1-way icache | 4-way icache |
15+
| no ITIM | ITIM at 0x0800\_0000 |
16+
| 16 kB DTIM | 64 kB DTIM |
17+
| no perf counters | 2 perf counters, hpmcounter3 and hpmcounter4 |
18+
| no CLICs | 3 CLICs (BTN0, BTN1 and BTN2) |
19+
20+
Like the Freedom E300 Arty FPGA Dev Kit, the X300 is designed to be mapped onto
21+
an [Arty FPGA Evaluation
22+
Kit](https://www.xilinx.com/products/boards-and-kits/arty.html).
23+
24+
### Bootrom
25+
26+
The default bootrom consists of a program that immediately jumps to address
27+
0x20400000, which is 0x00400000 bytes into the SPI flash memory on the Arty
28+
board.
29+
30+
## Requirements
31+
32+
### Vivado 2017.1 (or later)
33+
34+
You'll need Vivado to synthesize the bistream for the Arty FPGA. You should
35+
have received a single node license and instructions how to install Vivado with
36+
your Arty FPGA Dev Kit.
37+
38+
### RISC-V Toolchain
39+
40+
To compile the bootloader for the X300, the RISC-V software toolchain must be
41+
installed locally and the $(RISCV) environment variable must point to the
42+
location of where the RISC-V toolchains are installed. We recommend you build
43+
the toolchain yourself from
44+
[riscv/riscv-gnu-toolchain](https://github.com/riscv/riscv-gnu-toolchain/tree/411d1345507e5313c3575720f128be9e6c0ed941)
45+
46+
Run the following commands to clone the repository and get started:
47+
48+
```sh
49+
$ git clone https://github.com/hex-five/multizone-fpga.git
50+
$ cd multizone-fpga
51+
$ git submodule update --init --recursive
52+
```
53+
54+
## Building
55+
56+
To compile the bistream, run
57+
58+
```sh
59+
$ make -f Makefile.x300artydevkit mcs
60+
```
61+
62+
These will place the files under `builds/x300artydevkit/obj`.
63+
64+
Note that in order to run the `mcs` target, you need to have the `vivado`
65+
executable on your `PATH`.
66+
67+
## Running
68+
69+
For instructions for getting the generated image onto an FPGA and programming
70+
it with software using the [Freedom E
71+
SDK](https://github.com/sifive/freedom-e-sdk), please see the [Freedom E310
72+
Arty FPGA Dev Kit Getting Started
73+
Guide](https://www.sifive.com/documentation/freedom-soc/freedom-e300-arty-fpga-dev-kit-getting-started-guide/).

build.sbt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// See LICENSE for license details.
2-
organization := "com.sifive"
3-
name := "freedom"
2+
// Modifications copyright (C) 2019 Hex-Five
3+
organization := "com.hex-five"
4+
name := "x300"
45
version := "0.1.0"
56

67
lazy val commonSettings = Seq(
@@ -25,14 +26,10 @@ lazy val sifiveBlocks = (project in file("sifive-blocks")).
2526
dependsOn(rocketChip).
2627
settings(commonSettings: _*)
2728

28-
lazy val nvdlaBlocks = (project in file("nvidia-dla-blocks")).
29-
dependsOn(rocketChip).
30-
settings(commonSettings: _*)
31-
3229
lazy val fpgaShells = (project in file("fpga-shells")).
3330
dependsOn(rocketChip, sifiveBlocks).
3431
settings(commonSettings: _*)
3532

36-
lazy val freedomPlatforms = (project in file(".")).
37-
dependsOn(rocketChip, sifiveBlocks, nvdlaBlocks, fpgaShells).
33+
lazy val x300 = (project in file(".")).
34+
dependsOn(rocketChip, sifiveBlocks, fpgaShells).
3835
settings(commonSettings: _*)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// See LICENSE for license details.
2+
// Copyright (C) 2018-2019 Hex-Five
3+
package sifive.fpgashells.devices.xilinx.xilinxethernetlite
4+
5+
import Chisel._
6+
import freechips.rocketchip.amba.axi4._
7+
import freechips.rocketchip.config.Parameters
8+
import freechips.rocketchip.diplomacy._
9+
import freechips.rocketchip.tilelink._
10+
import freechips.rocketchip.interrupts._
11+
import freechips.rocketchip.subsystem.{CrossesToOnlyOneClockDomain, CacheBlockBytes}
12+
import sifive.fpgashells.ip.xilinx.ethernetlite.{EthernetLite, PhyPort, MdioPort}
13+
14+
class XilinxEthernetLite(implicit p: Parameters, val crossing: ClockCrossingType = NoCrossing)
15+
extends LazyModule with CrossesToOnlyOneClockDomain
16+
{
17+
val ethernetlite = LazyModule(new EthernetLite)
18+
19+
val slave: TLInwardNode =
20+
(ethernetlite.slave
21+
:= AXI4Buffer()
22+
:= AXI4UserYanker()
23+
:= AXI4Deinterleaver(p(CacheBlockBytes))
24+
:= AXI4IdIndexer(idBits=1)
25+
:= TLToAXI4(adapterName = Some("ethernetlite")))
26+
27+
val intnode: IntOutwardNode = ethernetlite.intnode
28+
29+
lazy val module = new LazyModuleImp(this) {
30+
val io = IO(new Bundle {
31+
val port = new Bundle with PhyPort
32+
with MdioPort {
33+
}
34+
})
35+
36+
ethernetlite.module.io.clockreset.s_axi_aclk := clock
37+
ethernetlite.module.io.clockreset.s_axi_aresetn := ~reset
38+
39+
io.port <> ethernetlite.module.io.port
40+
}
41+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// See LICENSE for license details.
2+
// Copyright (C) 2018-2019 Hex-Five
3+
package sifive.fpgashells.devices.xilinx.xilinxethernetlite
4+
5+
import Chisel._
6+
import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp, BufferParams}
7+
import freechips.rocketchip.subsystem.BaseSubsystem
8+
import freechips.rocketchip.tilelink._
9+
import freechips.rocketchip.interrupts.IntSyncCrossingSink
10+
11+
import sifive.fpgashells.ip.xilinx.ethernetlite.{PhyPort, MdioPort}
12+
13+
trait HasSystemXilinxEthernetLite { this: BaseSubsystem =>
14+
val xilinxethernetlite = LazyModule(new XilinxEthernetLite)
15+
private val cname = "xilinxethernetlite"
16+
sbus.coupleTo(s"slave_named_$cname") { xilinxethernetlite.crossTLIn(xilinxethernetlite.slave) :*= TLWidthWidget(sbus.beatBytes) :*= _ }
17+
ibus.fromSync := xilinxethernetlite.crossIntOut(xilinxethernetlite.intnode)
18+
}
19+
20+
trait HasSystemXilinxEthernetLiteModuleImp extends LazyModuleImp {
21+
val outer: HasSystemXilinxEthernetLite
22+
val phy = IO(new Bundle with PhyPort with MdioPort {})
23+
24+
phy <> outer.xilinxethernetlite.module.io.port
25+
}

fpga-shells/src/main/scala/ip/xilinx/Xilinx.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// See LICENSE for license details.
2+
// Modifications copyright (C) 2018-2019 Hex-Five
23
package sifive.fpgashells.ip.xilinx
34

45
import Chisel._
@@ -25,6 +26,7 @@ class mmcm extends BlackBox {
2526
val clk_out1 = Output(Clock())
2627
val clk_out2 = Output(Clock())
2728
val clk_out3 = Output(Clock())
29+
val clk_out4 = Output(Clock())
2830
val resetn = Input(Bool())
2931
val locked = Output(Bool())
3032
}

0 commit comments

Comments
 (0)