Skip to content

Commit

Permalink
Merge branch 'calyx-float' into float
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitnigam authored Oct 26, 2024
2 parents 86434a5 + c1b2037 commit a0cb15b
Show file tree
Hide file tree
Showing 463 changed files with 1,994,474 additions and 75,159 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Check calyx build
run: ./target/debug/calyx --version
- name: validate playground config
run: node web/validate-data.js
run: node web/validate-data.js

# Get the hash of the Dockerfile
hash:
Expand Down Expand Up @@ -120,10 +120,10 @@ jobs:
fud c stages.interpreter.exec /home/calyx/target/debug/cider
- name: Runt tests
working-directory: /home/calyx
working-directory: /home/calyx/interp/tests
run: |
# Run the remaining tests
runt interp -x 'relay' -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 Expand Up @@ -187,7 +187,7 @@ jobs:
working-directory: /home/calyx
run: |
runt -i 'cocotb' -d -o fail -j 1 --max-futures 1
- name: Runt tests
working-directory: /home/calyx
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ tools/profiler/tmp/
tools/profiler/logs

temp/

# for running a venv
.venv
24 changes: 24 additions & 0 deletions .hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#/bin/sh

function check {
prog=$1
shift
"$prog" "$@"
if [ $? -ne 0 ]; then
exit 1
fi
}

check cargo clippy

staged_py_files=$(git diff --cached --name-only --diff-filter=ACM | grep '\.py$')

if [ -n "$staged_py_files" ]; then
flake8_executable=$(which flake8 || which flake)
if [ -z "$flake8_executable" ]; then
echo "flake is not installed"
exit 1
else
check "$flake8_executable" $staged_py_files
fi
fi
123 changes: 107 additions & 16 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
6 changes: 3 additions & 3 deletions calyx-frontend/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
use super::parser;
use crate::{Attributes, PortDef, Primitive};
use atty::Stream;
use calyx_utils::{CalyxResult, Error, GPosIdx, Id};
use calyx_utils::{CalyxResult, Error, GPosIdx, Id, PosString};
use std::{num::NonZeroU64, path::PathBuf};

/// Corresponds to an individual Calyx file.
#[derive(Debug)]
pub struct NamespaceDef {
/// Path to extern files.
pub imports: Vec<String>,
pub imports: Vec<PosString>,
/// List of component definitions.
pub components: Vec<ComponentDef>,
/// Extern statements and any primitive declarations in them.
pub externs: Vec<(Option<String>, Vec<Primitive>)>,
pub externs: Vec<(Option<PosString>, Vec<Primitive>)>,
/// Optional opaque metadata
pub metadata: Option<String>,
}
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
Loading

0 comments on commit a0cb15b

Please sign in to comment.