Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Xilinx Virtex-7 FPGA VC709 board #835

Closed
wants to merge 28 commits into from

Conversation

mbs0221
Copy link

@mbs0221 mbs0221 commented Mar 25, 2021

Tested with sifive/fpga-shells#160

Related issue:

Type of change: new feature

Impact: new fpga target

Release Notes

Add support for Xilinx Virtex-7 FPGA VC709 board.

Currently, the Linux kernel (version 5.11.0-rc3) can boot with the help of Open-SBI (version v0.9), and login with UART/Serial port on the Xilinx Virtex-7 FPGA VC709 board!

	new file:   src/main/resources/vc709/uartboot/Makefile
	new file:   src/main/resources/vc709/uartboot/Makefile-back
	new file:   src/main/resources/vc709/uartboot/common.h
	new file:   src/main/resources/vc709/uartboot/crc16.c
	new file:   src/main/resources/vc709/uartboot/crc16.o
	new file:   src/main/resources/vc709/uartboot/gpoi.c
	new file:   src/main/resources/vc709/uartboot/head.S
	new file:   src/main/resources/vc709/uartboot/hello.c
	new file:   src/main/resources/vc709/uartboot/include/bits.h
	new file:   src/main/resources/vc709/uartboot/include/const.h
	new file:   src/main/resources/vc709/uartboot/include/crc16.h
	new file:   src/main/resources/vc709/uartboot/include/devices/clint.h
	new file:   src/main/resources/vc709/uartboot/include/devices/gpio.h
	new file:   src/main/resources/vc709/uartboot/include/devices/plic.h
	new file:   src/main/resources/vc709/uartboot/include/devices/spi.h
	new file:   src/main/resources/vc709/uartboot/include/devices/uart.h
	new file:   src/main/resources/vc709/uartboot/include/kprintf.h
	new file:   src/main/resources/vc709/uartboot/include/platform.h
	new file:   src/main/resources/vc709/uartboot/include/riscv_test_defaults.h
	new file:   src/main/resources/vc709/uartboot/include/sections.h
	new file:   src/main/resources/vc709/uartboot/include/serial.h
	new file:   src/main/resources/vc709/uartboot/include/smp.h
	new file:   src/main/resources/vc709/uartboot/kprintf.c
	new file:   src/main/resources/vc709/uartboot/linker/bootrom.elf.lds
	new file:   src/main/resources/vc709/uartboot/linker/memory.lds
	new file:   src/main/resources/vc709/uartboot/plic.c
	new file:   src/main/resources/vc709/uartboot/sd.c
	new file:   src/main/resources/vc709/uartboot/serial.c
	new file:   src/main/resources/vc709/uartboot/uart.c
	new file:   src/main/resources/vc709/uartsend/Makefile
	new file:   src/main/resources/vc709/uartsend/serial
	new file:   src/main/resources/vc709/uartsend/serial.c
	new file:   src/main/resources/vc709/uartsend/serial.o
	new file:   src/main/scala/vc709/Configs.scala
	new file:   src/main/scala/vc709/CustomOverlays.scala
	new file:   src/main/scala/vc709/TestHarness.scala
	modified:   Makefile
	modified:   fpga/src/main/scala/vc709/Configs.scala
	modified:   fpga/src/main/scala/vc709/TestHarness.scala
	modified:   fpga/fpga-shells (new commits, modified content)
	modified:   generators/rocket-chip (new commits)
	modified:   src/main/resources/vc709/uartboot/head.S
	modified:   src/main/resources/vc709/uartboot/linker/bootrom.elf.lds
	modified:   src/main/resources/vc709/uartboot/linker/memory.lds
	modified:   src/main/scala/vc709/Configs.scala
	modified:   src/main/scala/vc709/CustomOverlays.scala
	modified:   src/main/scala/vc709/TestHarness.scala
	modified:   src/main/scala/vc709/Configs.scala
	modified:   src/main/scala/vc709/CustomOverlays.scala
	new file:   src/main/scala/vc709/HarnessBinders.scala
	modified:   src/main/scala/vc709/TestHarness.scala
	modified:   Makefile
	deleted:    src/main/resources/vc709/uartboot/crc16.o
	modified:   src/main/resources/vc709/uartboot/head.S
	modified:   src/main/resources/vc709/uartboot/linker/bootrom.elf.lds
	modified:   src/main/resources/vc709/uartboot/linker/memory.lds
@mbs0221 mbs0221 changed the title vc709 dev Add support for Xilinx Virtex-7 FPGA VC709 board Mar 25, 2021
#########################################################################################
# general cleanup rules
#########################################################################################
.PHONY: clean
clean:
rm -rf $(gen_dir)
Copy link
Contributor

@abejgonzalez abejgonzalez Mar 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Chipyard we have this clean target "clean" everything (hence the gen_dir being deleted). I wouldn't be opposed to adding a new target like clean-specific (or a better name) that just deletes the sources related to this config.

So I would revert this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your suggestion that It would be better to have a new target like clean-specific for a certain config!

@@ -71,6 +85,7 @@ default: $(mcs)
# misc. directories
#########################################################################################
fpga_dir := $(base_dir)/fpga/fpga-shells/$(FPGA_BRAND)
fpga_board_script_dir := $(fpga_dir)/$(BOARD)/tcl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this used?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is originally used in sifive/freedom. I do not remember the original intention. It can be removed since we no longer need it currently.

@@ -120,9 +135,19 @@ debug-bitstream: $(build_dir)/obj/post_synth.dcp
$(build_dir)/debug_obj \
$(fpga_common_script_dir)

MCS_FILE := $(build_dir)/obj/$(MODEL).mcs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the MCS file used for? I removed this when originally setting up this work to keep things clean.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since every time we power off the board, the uploaded bit-stream will be lost. When working around the kernel after building up the prototype, we would not want to upload the bit-stream too often. Having a mcs file is better choice. It will save our time in the post stage of testing the prototype!

@@ -0,0 +1,9 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mis-spelled filename gpoi -> gpio.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a mistake to be corrected.

@@ -0,0 +1,50 @@
# Guide
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 points here. 1st. We are currently trying to get FireMarshal to target the prototype platforms so a lot involving building Linux won't be necessary (stay tuned for that). 2nd. At a minimum, this should be put in markdown and put in the Chipyard docs in the prototyping section. Once that is done we can talk more about how to make this a bit more understandable for folks.

@abejgonzalez
Copy link
Contributor

First of all, thanks for the contribution! I gave a quick 1st pass on the PR.

May you change the target to the dev branch. We use that branch for development work.

As mentioned in this post: #784 (comment)... we are still trying to figure out some testing infrastructure since it's hard to test this stuff when we don't have the boards to run regressions. I'll let you know what the status is on that since that is a bit slow right now.

@mbs0221 mbs0221 changed the base branch from master to dev March 29, 2021 05:14
mbs0221 added 2 commits March 29, 2021 13:38
WithTLBackingMemory is moved to the front of WithSystemModifications so that the size of ExtMem is updated and in effect.
@mbs0221 mbs0221 requested a review from abejgonzalez March 29, 2021 06:24
@mbs0221 mbs0221 closed this May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants