hardcaml-examples provides a small framework for creating HardCaml based cores and six example designs. The framework code provides the general plumbing required to create a console based application with features including code generation, simulation, and waveform viewing. A recent update extends the framework so that cores can be run on a webpage.
- Sorting networks
- Linear feedback shift registers
- Wallace and Dadda tree multipliers
- Prefix networks
Plugging a design into the framework
A design compatible with the framework should implement the signature given in
A console application can be created as follows
The application should be linked with the
library. The following generic options will be available
||generate verilog netlist|
||generate vhdl netlist|
||generate C simulation model|
|-llvm||use LLVM backend to run testbench|
|-vpi||use Icarus Verilog to run testbench|
|-checktb||compare ocaml simulation with LLVM/VPI backend|
|-interactive||interactive text driven testbench mode|
||generate VCD file|
|-waveterm||integrated waveform viewer|
|-gtkwave||gtkwave waveform viewer|
The remaining options will configure design and testbench parameters.
A web based application is created by building two bytecode applications
hardcaml-framework.js) and compiling them with js_of_ocaml.
user interface (ie mydesign.js)
To include the application in a html page load the user interface in a script
tag and include a div with id
hardcaml-framework-webapp and a data attribute
create itself within the div.