Skip to content

Commit

Permalink
Implement Kevin's second review
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanuppal committed Nov 21, 2024
1 parent 6ce0fb6 commit cedaf99
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/calyx-ffi-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ proc-macro = true
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = { version = "2.0.69", features = ["full", "visit"] }
interp = { path = "../../interp" }
calyx-utils.workspace = true
calyx-frontend.workspace = true
calyx-ir.workspace = true
# bigint = "4.4.3"
2 changes: 1 addition & 1 deletion tools/calyx-ffi-macro/src/calyx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub fn parse_calyx_file(
args: &CalyxFFIMacroArgs,
file: PathBuf,
) -> Result<CalyxComponent, TokenStream> {
// there has to be a better way to find lib
// TODO(ethan): there has to be a better way to find lib
let home_dir = env::var("HOME").expect("user home not set");
let mut lib_path = PathBuf::from(home_dir);
lib_path.push(".calyx");
Expand Down
5 changes: 1 addition & 4 deletions tools/calyx-ffi-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ mod calyx;
mod parse;
mod util;

// this is super bad, might go out of sync with interp::WidthInt
type WidthInt = u32;

/// Connects this `struct` to a calyx component in the given file.
#[proc_macro_attribute]
pub fn calyx_ffi(attrs: TokenStream, item: TokenStream) -> TokenStream {
Expand Down Expand Up @@ -66,7 +63,7 @@ pub fn calyx_ffi(attrs: TokenStream, item: TokenStream) -> TokenStream {

port_names.push(port_name.clone());

let port_width = port.borrow().width as WidthInt;
let port_width = port.borrow().width as interp::WidthInt;
let width_getter = format_ident!("{}_width", port_name);
width_getters.push(quote! {
pub const fn #width_getter() -> calyx_ffi::value::WidthInt {
Expand Down

0 comments on commit cedaf99

Please sign in to comment.