Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated main.rkt to support selective generation of rosette's output-… #460

Merged
merged 14 commits into from
Aug 31, 2024

Conversation

cknizek
Copy link
Collaborator

@cknizek cknizek commented Aug 21, 2024

…smt feature from the commandline

(PR in response to @gussmith23's issue)

What this change does:

This change modifies main.rkt to support the command line flag --output-smt-path "path". The specified path will be used as the output to Rosette's output-smt feature.

The path you specify will become a folder, as there may be many SMT output files generated and placed in the selected path.

How this change does it:

It adds a new parameter, output-smt-path (initially set to #f) to main.rkt.

If output-smt-path becomes no longer equal to #f (i.e. it has been assigned in the commandline arguments to become something), the SMT output feature of Rosette will be activated. The output will be directed to the path specified.

How to use this change (see line 2 of the below code block):

// RUN: racket $LAKEROAD_DIR/bin/main.rkt \
// RUN:  --output-smt-path "example_test_using_include_smt_output_test" \
// RUN:  --solver bitwuzla \
// RUN:  --verilog-module-filepath %s \
// RUN:  --architecture xilinx-ultrascale-plus \
// RUN:  --template dsp \
// RUN:  --out-format verilog \
// RUN:  --top-module-name top \
// RUN:  --verilog-module-out-signal out:11 \
// RUN:  --pipeline-depth 1 \
// RUN:  --clock-name clk \
// RUN:  --module-name out \
// RUN:  --input-signal a:11 \
// RUN:  --input-signal b:11 \
// RUN:  --input-signal c:11 \
// RUN:  --input-signal d:11 \
// RUN:  --extra-cycles 3 \
// RUN:  --timeout 120 \
// RUN: | FileCheck %s

Copy link
Owner

@gussmith23 gussmith23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful!!!! Great initiative on adding this!!!

bin/main.rkt Outdated
@@ -144,6 +145,7 @@
(error "Output signal must be specified as <name>:<bw>"))
(verilog-module-out-signal (first splits))
(verilog-module-out-bitwidth (string->number (second splits))))]
["--output-smt-path" v "Specify the output of the SMT solver to a file." (output-smt-path v)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path actually refers to the directory where the files will be placed, not the file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops yeah you're right, I'll change the line to reflect this

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See this thread, still unresolved

bin/main.rkt Outdated Show resolved Hide resolved
Copy link
Owner

@gussmith23 gussmith23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you accidentally deleted main.rkt...

@cknizek
Copy link
Collaborator Author

cknizek commented Aug 28, 2024

Looks like you accidentally deleted main.rkt...

Dang, thanks for checking this... I think this somehow happened when I was trying to pipe the raco fmt bin/main.rkt output directly into bin/main.rkt.

I think the issue should be resolved now

Copy link
Collaborator Author

@cknizek cknizek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have re-added main.rkt. I think this PR should be good to go

bin/main.rkt Outdated
@@ -128,6 +129,7 @@
(when (not (file-exists? v))
(error (format "File ~a does not exist." v)))
(verilog-module-filepath v))]
["--output-smt-path" v "Specify the output of the SMT solver to a file." (output-smt-path v)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, this is a directory, not a file. Please change the docstring here.

Copy link
Owner

@gussmith23 gussmith23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When CI goes through, go ahead and merge!

@cknizek cknizek merged commit 5050fc6 into main Aug 31, 2024
4 checks passed
@cknizek cknizek deleted the enable_rosette_smt_output_via_cmdline branch August 31, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants