This repository has been archived by the owner on Mar 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Farzad Farshchi
committed
Jun 5, 2018
1 parent
4a8ec54
commit fdc03bc
Showing
6 changed files
with
195 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# See LICENSE for license details. | ||
base_dir := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))) | ||
BUILD_DIR := $(base_dir)/builds/u500vcu118devkit | ||
FPGA_DIR := $(base_dir)/fpga-shells/xilinx | ||
MODEL := U500VCU118DevKitFPGAChip | ||
PROJECT := sifive.freedom.unleashed.u500vcu118devkit | ||
export CONFIG_PROJECT := sifive.freedom.unleashed.u500vcu118devkit | ||
export CONFIG := U500VCU118DevKitConfig | ||
export BOARD := vcu118 | ||
export BOOTROM_DIR := $(base_dir)/bootrom/sdboot | ||
|
||
rocketchip_dir := $(base_dir)/rocket-chip | ||
sifiveblocks_dir := $(base_dir)/sifive-blocks | ||
VSRCS := \ | ||
$(rocketchip_dir)/vsrc/AsyncResetReg.v \ | ||
$(rocketchip_dir)/vsrc/plusarg_reader.v \ | ||
$(sifiveblocks_dir)/vsrc/SRLatch.v \ | ||
$(FPGA_DIR)/common/vsrc/PowerOnResetFPGAOnly.v \ | ||
$(FPGA_DIR)/$(BOARD)/vsrc/sdio.v \ | ||
$(FPGA_DIR)/$(BOARD)/vsrc/vcu118reset.v \ | ||
$(BUILD_DIR)/$(CONFIG_PROJECT).$(CONFIG).rom.v \ | ||
$(BUILD_DIR)/$(CONFIG_PROJECT).$(CONFIG).v | ||
|
||
include common.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule fpga-shells
updated
11 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// See LICENSE for license details. | ||
package sifive.freedom.unleashed.u500vcu118devkit | ||
|
||
import freechips.rocketchip.config._ | ||
import freechips.rocketchip.subsystem._ | ||
import freechips.rocketchip.devices.debug._ | ||
import freechips.rocketchip.devices.tilelink._ | ||
import freechips.rocketchip.diplomacy._ | ||
import freechips.rocketchip.system._ | ||
import freechips.rocketchip.tile._ | ||
|
||
import sifive.blocks.devices.gpio._ | ||
import sifive.blocks.devices.spi._ | ||
import sifive.blocks.devices.uart._ | ||
|
||
import sifive.fpgashells.devices.xilinx.xilinxvcu118mig.{MemoryXilinxDDRKey,XilinxVCU118MIGParams} | ||
|
||
// Default FreedomUVCU118Config | ||
class FreedomUVCU118Config extends Config( | ||
new WithJtagDTM ++ | ||
new WithNMemoryChannels(1) ++ | ||
new WithNBigCores(4) ++ | ||
new BaseConfig | ||
) | ||
|
||
// Freedom U500 VCU118 Dev Kit Peripherals | ||
class U500VCU118DevKitPeripherals extends Config((site, here, up) => { | ||
case PeripheryUARTKey => List( | ||
UARTParams(address = BigInt(0x64000000L))) | ||
case PeripherySPIKey => List( | ||
SPIParams(rAddress = BigInt(0x64001000L))) | ||
case PeripheryGPIOKey => List( | ||
GPIOParams(address = BigInt(0x64002000L), width = 4)) | ||
case PeripheryMaskROMKey => List( | ||
MaskROMParams(address = 0x10000, name = "BootROM")) | ||
}) | ||
|
||
// Freedom U500 VCU118 Dev Kit | ||
class U500VCU118DevKitConfig extends Config( | ||
new WithNExtTopInterrupts(0) ++ | ||
new U500VCU118DevKitPeripherals ++ | ||
new FreedomUVCU118Config().alter((site,here,up) => { | ||
case ErrorParams => ErrorParams(Seq(AddressSet(0x3000, 0xfff)), maxAtomic=site(XLen)/8, maxTransfer=128) | ||
case PeripheryBusKey => up(PeripheryBusKey, site).copy(frequency = 50000000) // 50 MHz hperiphery | ||
case MemoryXilinxDDRKey => XilinxVCU118MIGParams(address = Seq(AddressSet(0x80000000L,0x80000000L-1))) //2GB | ||
case DTSTimebase => BigInt(1000000) | ||
case ExtMem => up(ExtMem).copy(size = 0x80000000L) | ||
case JtagDTMKey => new JtagDTMConfig ( | ||
idcodeVersion = 2, // 1 was legacy (FE310-G000, Acai). | ||
idcodePartNum = 0x000, // Decided to simplify. | ||
idcodeManufId = 0x489, // As Assigned by JEDEC to SiFive. Only used in wrappers / test harnesses. | ||
debugIdleCycles = 5) // Reasonable guess for synchronization | ||
}) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// See LICENSE for license details. | ||
package sifive.freedom.unleashed.u500vcu118devkit | ||
|
||
import Chisel._ | ||
import chisel3.experimental.{withClockAndReset} | ||
|
||
import freechips.rocketchip.config._ | ||
import freechips.rocketchip.diplomacy._ | ||
|
||
import sifive.blocks.devices.gpio._ | ||
import sifive.blocks.devices.pinctrl.{BasePin} | ||
|
||
import sifive.fpgashells.shell.xilinx.vcu118shell._ | ||
import sifive.fpgashells.ip.xilinx.{IOBUF} | ||
|
||
//------------------------------------------------------------------------- | ||
// PinGen | ||
//------------------------------------------------------------------------- | ||
|
||
object PinGen { | ||
def apply(): BasePin = { | ||
new BasePin() | ||
} | ||
} | ||
|
||
//------------------------------------------------------------------------- | ||
// U500VCU118DevKitFPGAChip | ||
//------------------------------------------------------------------------- | ||
|
||
class U500VCU118DevKitFPGAChip(implicit override val p: Parameters) | ||
extends VCU118Shell | ||
with HasDDR3 { | ||
|
||
//----------------------------------------------------------------------- | ||
// DUT | ||
//----------------------------------------------------------------------- | ||
|
||
// Connect the clock to the 50 Mhz output from the PLL | ||
dut_clock := clk50 | ||
withClockAndReset(dut_clock, dut_reset) { | ||
val dut = Module(LazyModule(new U500VCU118DevKitSystem).module) | ||
|
||
//--------------------------------------------------------------------- | ||
// Connect peripherals | ||
//--------------------------------------------------------------------- | ||
|
||
connectDebugJTAG(dut) | ||
connectSPI (dut) | ||
connectUART (dut) | ||
connectMIG (dut) | ||
|
||
//--------------------------------------------------------------------- | ||
// GPIO | ||
//--------------------------------------------------------------------- | ||
|
||
val gpioParams = p(PeripheryGPIOKey) | ||
val gpio_pins = Wire(new GPIOPins(() => PinGen(), gpioParams(0))) | ||
|
||
GPIOPinsFromPort(gpio_pins, dut.gpio(0)) | ||
|
||
gpio_pins.pins.foreach { _.i.ival := Bool(false) } | ||
//gpio_pins.pins.zipWithIndex.foreach { | ||
// case(pin, idx) => led(idx) := pin.o.oval | ||
//} | ||
|
||
// tie to zero | ||
//for( idx <- 7 to 4 ) { led(idx) := false.B } | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// See LICENSE for license details. | ||
package sifive.freedom.unleashed.u500vcu118devkit | ||
|
||
import Chisel._ | ||
|
||
import freechips.rocketchip.config._ | ||
import freechips.rocketchip.subsystem._ | ||
import freechips.rocketchip.devices.debug._ | ||
import freechips.rocketchip.devices.tilelink._ | ||
import freechips.rocketchip.diplomacy._ | ||
import freechips.rocketchip.system._ | ||
|
||
import sifive.blocks.devices.gpio._ | ||
import sifive.blocks.devices.spi._ | ||
import sifive.blocks.devices.uart._ | ||
|
||
import sifive.fpgashells.devices.xilinx.xilinxvcu118mig._ | ||
|
||
//------------------------------------------------------------------------- | ||
// U500VCU118DevKitSystem | ||
//------------------------------------------------------------------------- | ||
|
||
class U500VCU118DevKitSystem(implicit p: Parameters) extends RocketSubsystem | ||
with HasPeripheryMaskROMSlave | ||
with HasPeripheryDebug | ||
with HasSystemErrorSlave | ||
with HasPeripheryUART | ||
with HasPeripherySPI | ||
with HasPeripheryGPIO | ||
with HasMemoryXilinxVCU118MIG { | ||
override lazy val module = new U500VCU118DevKitSystemModule(this) | ||
} | ||
|
||
class U500VCU118DevKitSystemModule[+L <: U500VCU118DevKitSystem](_outer: L) | ||
extends RocketSubsystemModuleImp(_outer) | ||
with HasRTCModuleImp | ||
with HasPeripheryDebugModuleImp | ||
with HasPeripheryUARTModuleImp | ||
with HasPeripherySPIModuleImp | ||
with HasPeripheryGPIOModuleImp | ||
with HasMemoryXilinxVCU118MIGModuleImp { | ||
// Reset vector is set to the location of the mask rom | ||
val maskROMParams = p(PeripheryMaskROMKey) | ||
global_reset_vector := maskROMParams(0).address.U | ||
} |