Skip to content

Commit

Permalink
Fix INST Parameter Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Teddy-van-Jerry committed Apr 7, 2024
1 parent 88d419e commit c6295b8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -8,3 +8,6 @@

# macOS
.DS_Store

# This Project
/private
2 changes: 1 addition & 1 deletion Cargo.lock

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

12 changes: 10 additions & 2 deletions Cargo.toml
Expand Up @@ -3,12 +3,20 @@ name = "pytv"
description = "Python Templated Verilog"
repository = "https://github.com/autohdw/pytv"
authors = ["Teddy van Jerry <me@teddy-van-jerry.org>"]
version = "0.5.2"
version = "0.5.3"
readme = "README.md"
license = "GPL-3.0-or-later"
keywords = ["verilog", "python", "template", "generation"]
categories = ["template-engine", "compilers", "development-tools"]
exclude = ["examples/*", "target/*", "Cargo.lock", ".github/*", ".vscode/*", ".DS_Store"]
exclude = [
"examples/*",
"target/*",
"Cargo.lock",
".github/*",
".vscode/*",
".DS_Store",
"private/*",
]
edition = "2021"

[features]
Expand Down
2 changes: 1 addition & 1 deletion src/convert.rs
Expand Up @@ -281,7 +281,7 @@ impl Convert {
" s = [' .%s(%s)' % tuple for tuple in tuples]\n",
" return ('' if first_port else ',\\n') + ',\\n'.join(s)\n\n",
"def _verilog_vparams_var_map(tuples, first_vparam):\n",
" s = ['\\n parameter %s = %s' % tuple for tuple in tuples]\n",
" s = ['\\n .%s(%s)' % tuple for tuple in tuples]\n",
" return ('#(' if first_vparam else ',') + ','.join(s)\n",
),
self.output_inst_file_name()
Expand Down
4 changes: 2 additions & 2 deletions src/inst.rs
Expand Up @@ -140,7 +140,7 @@ impl Convert {
} else {
writeln!(
stream,
"print(f'{}\\n parameter {} = {}', end='')",
"print(f'{}\\n .{}({})', end='')",
if first_vparam {
first_vparam = false;
"#("
Expand All @@ -161,7 +161,7 @@ impl Convert {
}
}
if !first_vparam {
writeln!(stream, "print(f')')")?;
writeln!(stream, "print(')')")?;
}
match inst_map["name"].as_str() {
Some(name) => writeln!(
Expand Down

0 comments on commit c6295b8

Please sign in to comment.