Skip to content

Commit

Permalink
Merge branch 'main' into profiling-par-arms
Browse files Browse the repository at this point in the history
  • Loading branch information
ayakayorihiro committed Aug 15, 2024
2 parents 9095bc9 + c41fdae commit c378a1d
Show file tree
Hide file tree
Showing 182 changed files with 1,968,783 additions and 1,722,892 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
working-directory: /home/calyx/interp/tests
run: |
# Run the remaining tests
runt -x '(numeric types correctness and parsing)|(tcam testing)|(../../tests/correctness/pipelined-mac.futil)|(../../tests/correctness/std-bit-slice.futil)|(polybench)' -d -o fail
runt -x '(numeric types correctness and parsing)|(tcam testing)|(../../tests/correctness/pipelined-mac.futil)' -d -o fail
- name: Source code tests
uses: actions-rs/cargo@v1
Expand Down
119 changes: 105 additions & 14 deletions Cargo.lock

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

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,10 @@ calyx-frontend = { path = "calyx-frontend" }
[[bench]]
name = "component-sharing"
harness = false


[profile.test.package.proptest]
opt-level = 3

[profile.test.package.rand_chacha]
opt-level = 3
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

# Install python dependencies cocotb==1.6.2 seems to be for Xilinx cocotb tests
RUN python3 -m pip install numpy flit prettytable wheel hypothesis pytest simplejson cocotb==1.6.2
# Need to pin the numpy version since there are TVM issues with versions 2 and above
RUN python3 -m pip install numpy==1.26.4 flit prettytable wheel hypothesis pytest simplejson cocotb==1.6.2
# Current cocotb-bus has a bug that is fixed in more up to date repo
RUN python3 -m pip install git+https://github.com/cocotb/cocotb-bus.git cocotbext-axi

Expand Down Expand Up @@ -80,7 +81,8 @@ ENV PYTHONPATH=/root/.local/lib/python3.9/site-packages:$PYTHONPATH
WORKDIR /home/calyx
run mkdir -p ~/.local/bin
RUN ln -s /home/calyx/target/debug/fud2 ~/.local/bin/
RUN printf "[calyx]\nbase = \"/home/calyx\"" >> ~/.config/fud2.toml
RUN printf "dahlia = \"/home/dahlia/fuse\"\n" >> ~/.config/fud2.toml
RUN printf "[calyx]\nbase = \"/home/calyx\"\n" >> ~/.config/fud2.toml

# Install calyx-py
WORKDIR /home/calyx/calyx-py
Expand Down
4 changes: 4 additions & 0 deletions calyx-frontend/src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ pub enum BoolAttr {
#[strum(serialize = "promoted")]
/// denotes a static component or control promoted from dynamic
Promoted,
#[strum(serialize = "fast")]
/// https://github.com/calyxir/calyx/issues/1828
Fast,
}

impl From<BoolAttr> for Attribute {
fn from(attr: BoolAttr) -> Self {
Attribute::Bool(attr)
Expand Down
37 changes: 27 additions & 10 deletions calyx-opt/src/passes/metadata_table_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::path::PathBuf;
/// Metadata stores a Map between each group name and data used in the metadata table (specified in PR #2022)
#[derive(Default)]
pub struct Metadata {
groups: LinkedHashMap<Id, (usize, PathBuf)>,
groups: LinkedHashMap<(Id, Id), ((usize, usize), PathBuf)>,
}

impl Metadata {
Expand All @@ -18,8 +18,14 @@ impl Metadata {
}

/// Add a new entry to the metadata table
fn add_entry(&mut self, name: Id, line: usize, path: PathBuf) {
let ins = self.groups.insert(name, (line, path));
fn add_entry(
&mut self,
comp_name: Id,
name: Id,
span: (usize, usize),
path: PathBuf,
) {
let ins = self.groups.insert((comp_name, name), (span, path));
if let Some(_v) = ins {
panic!("Two of same group name found")
}
Expand All @@ -30,9 +36,10 @@ impl fmt::Display for Metadata {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let grps = &self.groups;

for (name, (line_num, file)) in grps {
for ((comp, name), ((start, end), file)) in grps {
let file = file.to_str().unwrap();
writeln!(f, " {name}: {file} {line_num}")?;

writeln!(f, "{comp}.{name}: {file} {start}-{end}")?;
}

Ok(())
Expand All @@ -58,8 +65,13 @@ impl Visitor for Metadata {
for rcc_grp in cmpt_iter {
let grp = rcc_grp.borrow_mut();
let pos_data = grp.attributes.copy_span();
let (file, line_num) = pos_data.get_line_num();
table.add_entry(grp.name(), line_num, PathBuf::from(file));
let (file, span) = pos_data.get_line_num();
table.add_entry(
component.name,
grp.name(),
span,
PathBuf::from(file),
); //hm may need to actually use the full name of the group
}

ctx.metadata = Some(table.to_string());
Expand All @@ -83,9 +95,14 @@ mod tests {
assert_eq!(empt_string, "");

let path = PathBuf::from("/temp/path/for/testing.futil");
data.add_entry(Id::from("group_1"), 12, path.clone());
data.add_entry(Id::from("group_2"), 23, path);
data.add_entry(
Id::from("main"),
Id::from("group_1"),
(12, 16),
path.clone(),
);
data.add_entry(Id::from("main"), Id::from("group_2"), (23, 28), path);
let test_string = data.to_string();
assert_eq!(test_string, " group_1: /temp/path/for/testing.futil 12\n group_2: /temp/path/for/testing.futil 23\n")
assert_eq!(test_string, "main.group_1: /temp/path/for/testing.futil 12-16\nmain.group_2: /temp/path/for/testing.futil 23-28\n")
}
}
Loading

0 comments on commit c378a1d

Please sign in to comment.