From 92c8156c1a874a8210631fdf9e15dceeac19cdcc Mon Sep 17 00:00:00 2001 From: Johann Rudloff Date: Thu, 18 Jul 2019 20:44:15 +0200 Subject: [PATCH] Move write_* functions closer together. --- lib/export_spice.ml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/export_spice.ml b/lib/export_spice.ml index 17755c0..e6c3c9a 100644 --- a/lib/export_spice.ml +++ b/lib/export_spice.ml @@ -7,15 +7,6 @@ let comp_ignored comp = comp.Comp.ref.[0] = '#' || Fields.get comp.Comp.fields Fields.Keys.spice_netlist_enabled "Y" <> "Y" -let write_comp outch pin_cache comp name = - let pin_nets = map (fun pin -> - Hashtbl.find pin_cache (comp.Comp.ref, pin.Pin.number) - ) comp.Comp.part.CompDef.pins in - output_string outch name; - output_string outch (" " ^ (String.concat " " pin_nets)); - output_string outch (" " ^ (comp.Comp.value)); - output_string outch "\n" - let make_cache kf vf xs = let tbl = Hashtbl.create (Enum.count xs) in Enum.iter (fun x -> @@ -41,6 +32,15 @@ let make_unique used name = in helper 2 end +let write_comp outch pin_cache comp name = + let pin_nets = map (fun pin -> + Hashtbl.find pin_cache (comp.Comp.ref, pin.Pin.number) + ) comp.Comp.part.CompDef.pins in + output_string outch name; + output_string outch (" " ^ (String.concat " " pin_nets)); + output_string outch (" " ^ (comp.Comp.value)); + output_string outch "\n" + let write_netlist outch schematic netlist = let net_names = make_cache id ( fun net_name -> Netlist.driver_net_name netlist net_name -- 2.45.2