From 82b7d888bc0d9161a05069b7f30d10a629b8ea79 Mon Sep 17 00:00:00 2001 From: NotAFile Date: Sun, 30 Jan 2022 23:54:19 +0100 Subject: [PATCH] start on typed IR --- src/frontend.rs | 1 + src/frontend/typed_ir.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/frontend/typed_ir.rs diff --git a/src/frontend.rs b/src/frontend.rs index d7f012e..8b340ba 100644 --- a/src/frontend.rs +++ b/src/frontend.rs @@ -9,6 +9,7 @@ pub use types::{Type, TypeStruct}; mod callable; pub mod types; +pub mod typed_ir; /// lots of code is still not width-aware, this constant keeps track of that const TODO_WIDTH: u32 = 1; diff --git a/src/frontend/typed_ir.rs b/src/frontend/typed_ir.rs new file mode 100644 index 0000000..c090722 --- /dev/null +++ b/src/frontend/typed_ir.rs @@ -0,0 +1,16 @@ +use super::types::Type; + +/// an abstract element that performs some kind of computation on a value +struct Element<'ty> { + pub id: u32, + pub inputs: Vec>, + pub typ: Type<'ty>, +} + +struct Signal<'ty> { + pub id: u32, + pub typ: Type<'ty> +} + +struct Expression { +}