From 4e1aaf316457f4d4f045fd3ebe500cd70f6bafcc Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Thu, 2 Jan 2014 19:21:04 +0100 Subject: Renamed example cpu file --- cpu/cpu.ml | 19 ------------------- cpu/example_cpu.ml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 cpu/cpu.ml create mode 100644 cpu/example_cpu.ml (limited to 'cpu') diff --git a/cpu/cpu.ml b/cpu/cpu.ml deleted file mode 100644 index 2d60bec..0000000 --- a/cpu/cpu.ml +++ /dev/null @@ -1,19 +0,0 @@ -open Netlist_gen - -(* Dumb CPU that just does an 8-bit addition *) - -let sumz n i = - let x, set_x = loop n in - let r = reg n x in - let o1, o2 = Alu.nadder n i r (const "0") in - set_x o1, o2 - -let p = - let width = 16 in - let sum, r = sumz width (get "in") in - program - [ "in", width ] - [ "out", width, sum; - "r", 1, r ] - -let () = Netlist_gen.print stdout p diff --git a/cpu/example_cpu.ml b/cpu/example_cpu.ml new file mode 100644 index 0000000..2d60bec --- /dev/null +++ b/cpu/example_cpu.ml @@ -0,0 +1,19 @@ +open Netlist_gen + +(* Dumb CPU that just does an 8-bit addition *) + +let sumz n i = + let x, set_x = loop n in + let r = reg n x in + let o1, o2 = Alu.nadder n i r (const "0") in + set_x o1, o2 + +let p = + let width = 16 in + let sum, r = sumz width (get "in") in + program + [ "in", width ] + [ "out", width, sum; + "r", 1, r ] + +let () = Netlist_gen.print stdout p -- cgit v1.2.3