My list of random notes on DE10 Nano SoC related stuff
- SoC EDS (should be of same version as quartus)
- Altera SoC Workshop
Series on rocketboards
- *:it is for DE0 Nano but contains some useful information
- SoCEDS Getting Started on Intel FPGA Wiki
Install libpng12 to make Quartus happy
wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
&& sudo dpkg -i /tmp/libpng12.deb \
&& rm /tmp/libpng12.deb
Install quartus using this howto *:skip libpng12 step
- MPU: Micro Processor Unit
- HPS: Hard Processor System
- BSP: Board Support Package
$ qsys-script --script=soc_system.tcl
$ qsys-generate soc_system.qsys --synthesis=Verilog
$ quartus_sh --flow compile soc_system.qpf
$ quartus_cpf -c -o bitstream_compression=on file.sof file.rbf
$ screen /dev/ttyUSB0 115200
$ bsp-create-settings --type spl --bsp-dir bsp_build_dir/ --settings settings.bsp --preloader-settings-dir ./hps_isw_handoff/soc_system_hps_0
$ cd bsp_build_dir
$ make
$ make uboot
$ sudo $(which alt-boot-disk-util) -b uboot-socfpga/u-boot.img -a write /dev/sdX
$ sudo $(which alt-boot-disk-util) -p preloader-mkpimage.bin -a write /dev/sdX
constexpr size_t HPS_TO_FPGA_LW_BASE = 0xFF200000;
// Half part of phys memory
constexpr size_t HW_BUFFERS_PHYS_ADDR_BASE = 0x20000000;
uint8_t* mapPhysicalMemory(size_t base, size_t size) {
int fd = open("/dev/mem", O_RDWR | O_SYNC, 0);
if (fd == -1)
throw std::system_error(errno, std::generic_category());
int rw = PROT_READ | PROT_WRITE;
auto* mapped_base = reinterpret_cast<uint8_t*>(mmap(nullptr, size, rw, MAP_SHARED, fd, base));
if (mapped_base == MAP_FAILED)
throw std::system_error(errno, std::generic_category());
return mapped_base;
}
auto* base = mapPhysicalMemory(HPS_TO_FPGA_LW_BASE, 0x2000);