Skip to content

Commit

Permalink
Add GENERATED CODE header
Browse files Browse the repository at this point in the history
  • Loading branch information
VonTum committed Aug 5, 2024
1 parent af43134 commit 72a684e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
22 changes: 22 additions & 0 deletions philosophy/images/susLogo.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<mxfile host="Electron" modified="2024-08-02T11:37:41.020Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.5 Chrome/114.0.5735.243 Electron/25.3.1 Safari/537.36" etag="Nl6KpSo4MCRpTYcL4U9-" version="21.6.5" type="device">
<diagram name="Page-1" id="Hsbhw2hLou6ln3_cuhlk">
<mxGraphModel dx="384" dy="837" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="yl1WzndAGqq6fcokq75D-4" value="" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=0;fillColor=#cce5ff;strokeColor=#36393d;" vertex="1" parent="1">
<mxGeometry x="360" y="680" width="200" height="120" as="geometry" />
</mxCell>
<mxCell id="yl1WzndAGqq6fcokq75D-1" value="&lt;font style=&quot;font-size: 90px;&quot;&gt;SUS&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontFamily=Comic Neue;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DComic%2BNeue;fontStyle=1;fontSize=90;fontColor=#4F4F4F;" vertex="1" parent="1">
<mxGeometry x="359" y="681" width="200" height="120" as="geometry" />
</mxCell>
<mxCell id="yl1WzndAGqq6fcokq75D-7" value="" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=0;fillColor=#10739E;strokeColor=#36393d;" vertex="1" parent="1">
<mxGeometry x="360" y="640" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="yl1WzndAGqq6fcokq75D-8" value="" style="rounded=0;whiteSpace=wrap;html=1;strokeWidth=0;fillColor=#10739E;strokeColor=#36393d;" vertex="1" parent="1">
<mxGeometry x="360" y="800" width="200" height="40" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file added philosophy/images/susLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ fn codegen_instance(inst: &InstantiatedModule, md: &Module, out_file: &mut File)
}

fn make_output_file(name : &str) -> File {
let mut path = PathBuf::new();
let mut path = PathBuf::with_capacity(name.len()+"verilog_output/.sv".len());
path.push("verilog_output");
fs::create_dir_all(&path).unwrap();
path.push(name);
path.set_extension("sv");
File::create(path).unwrap()
let mut file = File::create(path).unwrap();

file.write_fmt(format_args!("// DO NOT EDIT THIS FILE\n// This file was generated with SUS Compiler {}", std::env!("CARGO_PKG_VERSION"))).unwrap();

file
}

fn codegen_to_file(md: &Module) {
Expand Down

0 comments on commit 72a684e

Please sign in to comment.