Skip to content

Commit a917164

Browse files
committed
Tidy up whitespace in generated package. #148
1 parent 105abdc commit a917164

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/peakrdl_regblock/hwif/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def top_node(self) -> AddrmapNode:
5050

5151

5252
def get_extra_package_params(self) -> str:
53-
lines = []
53+
lines = [""]
5454

5555
for param in self.top_node.inst.parameters:
5656
value = param.get_value()
@@ -70,7 +70,7 @@ def get_package_contents(self) -> str:
7070
"""
7171
If this hwif requires a package, generate the string
7272
"""
73-
lines = []
73+
lines = [""]
7474

7575
gen_in = self._gen_in_cls(self)
7676
structs_in = gen_in.get_struct(

src/peakrdl_regblock/package_tmpl.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ package {{ds.package_name}};
77
localparam {{ds.module_name.upper()}}_MIN_ADDR_WIDTH = {{ds.addr_width}};
88
localparam {{ds.module_name.upper()}}_SIZE = {{SVInt(ds.top_node.size)}};
99

10-
{{hwif.get_extra_package_params()|indent}}
10+
{{-hwif.get_extra_package_params()|indent}}
1111

12-
{{hwif.get_package_contents()|indent}}
12+
{{-hwif.get_package_contents()|indent}}
1313
endpackage
1414
{# (eof newline anchor) #}

tests/test_pkg_params/regblock.rdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ addrmap top #(
55
) {
66
reg reg_t {
77
regwidth = REGWIDTH;
8-
field {sw=rw; hw=na;} f[REGWIDTH] = 1;
8+
field {sw=rw; hw=r;} f[REGWIDTH] = 1;
99
};
1010
reg_t regs[N_REGS];
1111
};

0 commit comments

Comments
 (0)