-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from PedroAntunes178/master
SoC: Run in Cyclone V; Console enters Non-Canonical mode when necessary; BootLoader is generic and can load any firmware.
- Loading branch information
Showing
12 changed files
with
183 additions
and
131 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
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
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
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
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
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
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,53 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
|
||
ROOT_DIR = sys.argv[1] | ||
if len(sys.argv) > 2: | ||
RUN_LINUX = sys.argv[2] | ||
else: | ||
RUN_LINUX = "0" | ||
|
||
# Generate "iob_mem.txt" according to which binary firmware the SoC should load to RAM | ||
|
||
iob_mem_file = f"{ROOT_DIR}/hardware/iob_mem.txt" | ||
with open(iob_mem_file, "w") as file: | ||
if RUN_LINUX == "1": | ||
file.write( | ||
"fw_jump.bin 0\nImage 400000\niob_soc.dtb F80000\nrootfs.cpio.gz 1000000" | ||
) | ||
else: | ||
file.write("iob_soc_opencryptolinux_firmware.bin 0") | ||
|
||
|
||
# Fixes existing bsp.h and bsp.vh for Simulation | ||
|
||
bsp_file = f"{ROOT_DIR}/software/src/bsp.h" | ||
with open(bsp_file, "r") as file: | ||
content = file.read() | ||
|
||
if "define SIMULATION 1" in content: | ||
if RUN_LINUX == "1": | ||
bsp_file = f"{ROOT_DIR}/hardware/simulation/src/bsp.vh" | ||
with open(bsp_file, "w") as file: | ||
file.write( | ||
"`define BAUD 115200\n`define FREQ 100000000\n`define DDR_DATA_W 32\n`define DDR_ADDR_W 26\n`define SIMULATION 1" | ||
) | ||
|
||
bsp_file = f"{ROOT_DIR}/software/src/bsp.h" | ||
with open(bsp_file, "w") as file: | ||
file.write( | ||
"#define BAUD 115200\n#define FREQ 100000000\n#define DDR_DATA_W 32\n#define DDR_ADDR_W 26\n#define SIMULATION 1" | ||
) | ||
else: | ||
bsp_file = f"{ROOT_DIR}/hardware/simulation/src/bsp.vh" | ||
with open(bsp_file, "w") as file: | ||
file.write( | ||
"`define BAUD 3000000\n`define FREQ 100000000\n`define DDR_DATA_W 32\n`define DDR_ADDR_W 26\n`define SIMULATION 1" | ||
) | ||
|
||
bsp_file = f"{ROOT_DIR}/software/src/bsp.h" | ||
with open(bsp_file, "w") as file: | ||
file.write( | ||
"#define BAUD 3000000\n#define FREQ 100000000\n#define DDR_DATA_W 32\n#define DDR_ADDR_W 26\n#define SIMULATION 1" | ||
) |
File renamed without changes.
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
Oops, something went wrong.