-
Notifications
You must be signed in to change notification settings - Fork 2
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
SystemVerilog stubs generation #45
Conversation
The next commit should fix the existing CI to |
README.md
Outdated
@@ -217,6 +218,7 @@ The list of arguments for `hls`-mode is presented below: | |||
* `-h,--help`: *optional* flag; used to print the help-message about other arguments. | |||
* `--config <PATH>`: *required* filesystem-path option; used to specify the file for a JSON latency configuration file. Its format is presented in *JSON Configuration* section. | |||
* `--out-sv <PATH>`: *optional* filesystem-path option; used to specify the output SystemVerilog file. | |||
* `--out-sv-stubs <PATH>`: *optional* filesystem-path option; used to specify the output file for generated SystemVerilog stubs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out-sv-stubs -> out-sv-lib
"the output file for generated SystemVerilog stubs" -> "the output SystemVerilog file for generated operations library"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
config.json
Outdated
@@ -4,6 +4,7 @@ | |||
"asap_scheduler" : false, | |||
"lp_scheduler" : false, | |||
"out_sv" : "", | |||
"out_sv_stubs" : "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renaming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -37,4 +37,18 @@ def DFCIRLinearSchedulerPass: Pass<"dfcir-linear-scheduler-pass", "mlir::ModuleO | |||
let constructor = "mlir::dfcir::createDFCIRLinearSchedulerPass()"; | |||
} | |||
|
|||
def FIRRTLStubGeneratorPass: Pass<"firrtl-stub-generator-pass", "mlir::ModuleOp"> { | |||
let summary = "Generate stubs for pipelined computational modules, specified in FIRRTL."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Generate stubs for pipelined computational modules, specified in FIRRTL." -> ""Generate stub modules for pipelined computational operations.""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
// | ||
// Part of the Utopia HLS Project, under the Apache License v2.0 | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright 2021-2024 ISP RAS (http://www.ispras.ru) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2021-2024 -> 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here and in templates/stubs.tpl
.
} else { | ||
result->SetValue("OP", "*"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add separate branch for MUL operation, report an error ("Unsupported module: " ?) at the default branch
@@ -62,6 +62,7 @@ enum Scheduler { | |||
// Used for accessing specified output format paths. | |||
enum class OutputFormatID : uint8_t { | |||
SystemVerilog = 0, | |||
SVStubs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably renaming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
src/options.h
Outdated
@@ -36,6 +36,7 @@ | |||
#define ASAP_SCHEDULER_JSON "asap_scheduler" | |||
#define LP_SCHEDULER_JSON "lp_scheduler" | |||
#define OUT_SV_JSON "out_sv" | |||
#define OUT_SV_STUBS_JSON "out_sv_stubs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
src/options.h
Outdated
@@ -49,6 +50,7 @@ | |||
#define LP_SCHEDULER_FLAG CLI_FLAG("l") | |||
#define OUTPUT_GROUP "output" | |||
#define OUT_SV_ARG CLI_ARG("out-sv") | |||
#define OUT_SV_STUBS_ARG CLI_ARG("out-sv-stubs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
src/options.h
Outdated
outputGroup->add_option(OUT_SV_STUBS_ARG, | ||
outNames[OUT_FORMAT_ID_INT(SVStubs)], | ||
"Path to output stubs for SystemVerilog modules"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
src/options.h
Outdated
@@ -198,6 +203,7 @@ struct HlsOptions final : public AppOptions { | |||
get(json, ASAP_SCHEDULER_JSON, asapScheduler); | |||
get(json, LP_SCHEDULER_JSON, lpScheduler); | |||
get(json, OUT_SV_JSON, outNames[OUT_FORMAT_ID_INT(SystemVerilog)]); | |||
get(json, OUT_SV_STUBS_JSON, outNames[OUT_FORMAT_ID_INT(SVStubs)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed according to comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
This Pull Request introduces a new option for Utopia HLS CLI to generate stub modules for SystemVerilog, which can be useful in SystemVerilog syntax parsing (e.g. with Verilator).