To use the old version of hardcaml
- Create a directory ie
hardcaml_ujamjar
and cd into it touch jbuild-workspace
git clone ...
the required repositoriesopam install ...
the required dependenciesjbuilder build @install
will compile everything
open Core | |
open Hardcaml | |
(* Set this before construcing the circuit so that stack traces are stored inside | |
signals. *) | |
let () = Caller_id.set_mode Full_trace | |
(* A simple hierarchical circuit *) | |
module Add_sub = struct | |
module I = struct |
#require "base,stdio,ctypes.foreign";; | |
open Base | |
open Stdio | |
open Ctypes | |
open Foreign | |
(* getenv | |
A string is passed and a string, which doesn't require deallocation, is |
#require "delimcc";; | |
#require "hardcaml,hardcaml-waveterm,ppx_deriving_hardcaml";; | |
open Delimcc | |
open HardCaml | |
open Api | |
type ('a, 'b) t = Done | More of 'a * ('b -> ('a, 'b) t) | |
let gen f = |
#require "delimcc";; | |
#require "hardcaml,hardcaml-waveterm";; | |
open Delimcc | |
open HardCaml | |
open Api | |
type ('a, 'b) t = Done | More of 'a * ('b -> ('a, 'b) t) | |
let gen f = |
#require "hardcaml,ppx_deriving_hardcaml,hardcaml-waveterm,hardcaml-bloop,hardcaml-yosys";; | |
#mod_use "satvlog.ml";; |
#require "ppx_deriving_hardcaml,hardcaml-waveterm";; | |
open HardCaml | |
open Signal.Comb | |
module I = struct | |
type 'a t = { | |
arg_a : 'a[@bits 2]; | |
arg_b : 'a[@bits 2]; | |
}[@@deriving hardcaml] |
#require "delimcc";; | |
#require "hardcaml";; | |
open Delimcc | |
type ('a, 'b) t = Done | More of 'a * ('b -> ('a, 'b) t) | |
let gen f = | |
(* | |
* Note: the first value to yield gets thrown away as the generator |
open HardCaml | |
(* different register types *) | |
module Seq = struct | |
open Signal | |
open Types | |
open Seq | |
module type S = sig | |
include Interface.S | |
val reg : Api.Comb.t t -> Signal.Types.register |
(* | |
build with: | |
ocamlbuild -use-ocamlfind -package compiler-libs.common -package ppx_tools.metaquot ppx_hardcaml.native | |
*) | |
open Ast_mapper | |
open Ast_helper |