How to initialize contents of inferred Block RAM (BRAM) in Verilog

You are correct that you should use $readmemh inside an initial block. In order to make it so different instances of the module can have different initialization files, you should use a parameter like so: parameter MEM_INIT_FILE = “”; … initial begin if (MEM_INIT_FILE != “”) begin $readmemh(MEM_INIT_FILE, ram); end end The format is described … Read more

How to add a Linux kernel driver module as a Buildroot package?

Fully automated out-of-tree QEMU example A version of the setup below is also present here: https://github.com/cirosantilli/linux-kernel-module-cheat/tree/753cbe68ff50bea0982e1791c8a2178a999d8377/buildroot_packages/kernel_modules and documented at: https://cirosantilli.com/linux-kernel-module-cheat/kernel-modules-buildroot-package The setup below is full extracted from that repository however, and will work standalone. Source tree: buildroot/: Buildroot 2017.02, ideally as a git submodule kernel_module/: external package with some modules, ideally tracked in the git … Read more