peakrdl-busdecoder 0.6.6__py3-none-any.whl → 0.6.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,4 +37,4 @@ assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err | cpuif_wr_err;
37
37
  //--------------------------------------------------------------------------
38
38
  // Fanin CPU Bus interface signals
39
39
  //--------------------------------------------------------------------------
40
- {{fanin|walk(cpuif=cpuif)}}
40
+ {{fanin|walk(cpuif=cpuif)}}
@@ -38,4 +38,4 @@ assign {{cpuif.signal("PSLVERR")}} = cpuif_rd_err | cpuif_wr_err;
38
38
  //--------------------------------------------------------------------------
39
39
  // Fanin CPU Bus interface signals
40
40
  //--------------------------------------------------------------------------
41
- {{fanin|walk(cpuif=cpuif)}}
41
+ {{fanin|walk(cpuif=cpuif)}}
@@ -77,8 +77,8 @@ class AXI4LiteCpuif(BaseCpuif):
77
77
  if self.is_interface and node.is_array and node.array_dimensions:
78
78
  # Generate array index string [i0][i1]... for the intermediate signal
79
79
  array_idx = "".join(f"[i{i}]" for i in range(len(node.array_dimensions)))
80
- fanin["cpuif_wr_ack"] = f"{node.inst_name}_fanin_ready{array_idx}"
81
- fanin["cpuif_wr_err"] = f"{node.inst_name}_fanin_err{array_idx}"
80
+ fanin["cpuif_wr_ack"] = f"{node.inst_name}_fanin_wr_valid{array_idx}"
81
+ fanin["cpuif_wr_err"] = f"{node.inst_name}_fanin_wr_err{array_idx}"
82
82
  else:
83
83
  # Read side: ack comes from RVALID; err if RRESP[1] is set (SLVERR/DECERR)
84
84
  fanin["cpuif_wr_ack"] = self.signal("BVALID", node, "i")
@@ -119,4 +119,16 @@ class AXI4LiteCpuif(BaseCpuif):
119
119
  f"assign {inst_name}_fanin_ready{array_idx} = {master_prefix}{indexed_path}.RVALID;",
120
120
  f"assign {inst_name}_fanin_err{array_idx} = {master_prefix}{indexed_path}.RRESP[1];",
121
121
  f"assign {inst_name}_fanin_data{array_idx} = {master_prefix}{indexed_path}.RDATA;",
122
+ f"assign {inst_name}_fanin_wr_valid{array_idx} = {master_prefix}{indexed_path}.BVALID;",
123
+ f"assign {inst_name}_fanin_wr_err{array_idx} = {master_prefix}{indexed_path}.BRESP[1];",
124
+ ]
125
+
126
+ def fanin_intermediate_declarations(self, node: AddressableNode) -> list[str]:
127
+ if not node.array_dimensions:
128
+ return []
129
+
130
+ array_str = "".join(f"[{dim}]" for dim in node.array_dimensions)
131
+ return [
132
+ f"logic {node.inst_name}_fanin_wr_valid{array_str};",
133
+ f"logic {node.inst_name}_fanin_wr_err{array_str};",
122
134
  ]
@@ -26,9 +26,21 @@
26
26
  `endif
27
27
  {% endif -%}
28
28
 
29
+ logic axi_wr_valid;
30
+ logic axi_wr_invalid;
31
+ logic cpuif_wr_ack_int;
32
+ logic cpuif_rd_ack_int;
33
+
34
+ assign axi_wr_valid = {{cpuif.signal("AWVALID")}} & {{cpuif.signal("WVALID")}};
35
+ assign axi_wr_invalid = {{cpuif.signal("AWVALID")}} ^ {{cpuif.signal("WVALID")}};
36
+
37
+ // Ready/acceptance follows the simplified single-beat requirement
38
+ assign {{cpuif.signal("AWREADY")}} = axi_wr_valid;
39
+ assign {{cpuif.signal("WREADY")}} = axi_wr_valid;
40
+ assign {{cpuif.signal("ARREADY")}} = {{cpuif.signal("ARVALID")}};
29
41
 
30
42
  assign cpuif_req = {{cpuif.signal("AWVALID")}} | {{cpuif.signal("ARVALID")}};
31
- assign cpuif_wr_en = {{cpuif.signal("AWVALID")}} & {{cpuif.signal("WVALID")}};
43
+ assign cpuif_wr_en = axi_wr_valid;
32
44
  assign cpuif_rd_en = {{cpuif.signal("ARVALID")}};
33
45
 
34
46
  assign cpuif_wr_addr = {{cpuif.signal("AWADDR")}};
@@ -42,12 +54,14 @@ assign cpuif_wr_byte_en = {{cpuif.signal("WSTRB")}};
42
54
  // Read: ack=RVALID, err=RRESP[1] (SLVERR/DECERR), data=RDATA
43
55
  //
44
56
  assign {{cpuif.signal("RDATA")}} = cpuif_rd_data;
45
- assign {{cpuif.signal("RVALID")}} = cpuif_rd_ack;
57
+ assign cpuif_rd_ack_int = cpuif_rd_ack | cpuif_rd_sel.cpuif_err;
58
+ assign {{cpuif.signal("RVALID")}} = cpuif_rd_ack_int;
46
59
  assign {{cpuif.signal("RRESP")}} = (cpuif_rd_err | cpuif_rd_sel.cpuif_err | cpuif_wr_sel.cpuif_err) ? 2'b10 : 2'b00;
47
60
 
48
61
  // Write: ack=BVALID, err=BRESP[1]
49
- assign {{cpuif.signal("BVALID")}} = cpuif_wr_ack;
50
- assign {{cpuif.signal("BRESP")}} = (cpuif_wr_err | cpuif_wr_sel.cpuif_err | cpuif_rd_sel.cpuif_err) ? 2'b10 : 2'b00;
62
+ assign cpuif_wr_ack_int = cpuif_wr_ack | cpuif_wr_sel.cpuif_err | axi_wr_invalid;
63
+ assign {{cpuif.signal("BVALID")}} = cpuif_wr_ack_int;
64
+ assign {{cpuif.signal("BRESP")}} = (cpuif_wr_err | cpuif_wr_sel.cpuif_err | cpuif_rd_sel.cpuif_err | axi_wr_invalid) ? 2'b10 : 2'b00;
51
65
 
52
66
  //--------------------------------------------------------------------------
53
67
  // Fanout CPU Bus interface signals
@@ -64,4 +78,4 @@ assign {{cpuif.signal("BRESP")}} = (cpuif_wr_err | cpuif_wr_sel.cpuif_err | cpu
64
78
  //--------------------------------------------------------------------------
65
79
  // Fanin CPU Bus interface signals
66
80
  //--------------------------------------------------------------------------
67
- {{fanin|walk(cpuif=cpuif)}}
81
+ {{fanin|walk(cpuif=cpuif)}}
@@ -136,3 +136,7 @@ class BaseCpuif:
136
136
  List of assignment strings
137
137
  """
138
138
  return [] # Default: no intermediate assignments needed
139
+
140
+ def fanin_intermediate_declarations(self, node: AddressableNode) -> list[str]:
141
+ """Optional extra intermediate signal declarations for interface arrays."""
142
+ return []
@@ -72,12 +72,12 @@ class FaninGenerator(BusDecoderListener):
72
72
  def __str__(self) -> str:
73
73
  wr_ifb = IfBody()
74
74
  with wr_ifb.cm("cpuif_wr_sel.cpuif_err") as b:
75
- self._cpuif.fanin_wr(error=True)
75
+ b += self._cpuif.fanin_wr(error=True)
76
76
  self._stack[-1] += wr_ifb
77
77
 
78
78
  rd_ifb = IfBody()
79
79
  with rd_ifb.cm("cpuif_rd_sel.cpuif_err") as b:
80
- self._cpuif.fanin_rd(error=True)
80
+ b += self._cpuif.fanin_rd(error=True)
81
81
  self._stack[-1] += rd_ifb
82
82
 
83
83
  return "\n".join(map(str, self._stack))
@@ -94,6 +94,9 @@ class FaninIntermediateGenerator(BusDecoderListener):
94
94
  f"logic [{self._cpuif.data_width - 1}:0] {inst_name}_fanin_data{array_str};"
95
95
  )
96
96
 
97
+ # Allow CPU interface to add extra intermediate declarations (e.g., write responses)
98
+ self._declarations.extend(self._cpuif.fanin_intermediate_declarations(node))
99
+
97
100
  def _generate_intermediate_assignments(self, node: AddressableNode) -> str:
98
101
  """Generate assignments from interface array to intermediate signals."""
99
102
  inst_name = node.inst_name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: peakrdl-busdecoder
3
- Version: 0.6.6
3
+ Version: 0.6.7
4
4
  Summary: Generate a SystemVerilog bus decoder from SystemRDL for splitting CPU interfaces to multiple sub-address spaces
5
5
  Author: Arnav Sacheti
6
6
  License: LGPLv3
@@ -20,30 +20,30 @@ peakrdl_busdecoder/body/for_loop_body.py,sha256=lJYfDiB7MF9_mfbGEApoVHRViBCqpGRs
20
20
  peakrdl_busdecoder/body/if_body.py,sha256=S4oVS7yz04R1i-23W-aWpVcVZa5dW-H0FL_KnMy-Wsc,3261
21
21
  peakrdl_busdecoder/body/struct_body.py,sha256=74ItYoYD-GqEidxc-ncV5y8fzGoM47NI4GnnweclmS8,624
22
22
  peakrdl_busdecoder/cpuif/__init__.py,sha256=T8YrELGuOBIPgj1e86tNJ5tSCf7fXpPadqa71v5MEx8,59
23
- peakrdl_busdecoder/cpuif/base_cpuif.py,sha256=RknbZXMFsBcjR6FyPzF3mD4_lPQZxRDpt-5Vwbj5ef8,5036
24
- peakrdl_busdecoder/cpuif/fanin_gen.py,sha256=QnbJ_rTCI1HqP7cIGDGbS0q8rBhDzM_7FWcYEMotjP8,2661
25
- peakrdl_busdecoder/cpuif/fanin_intermediate_gen.py,sha256=hfvMyyx5ajEzvop3dzV37dT6Jn9yjORFnUkMAT1034A,5271
23
+ peakrdl_busdecoder/cpuif/base_cpuif.py,sha256=abc7WB5fI5NMwX5MMZfOOEA18f9bAVECoadC2XzW-gY,5222
24
+ peakrdl_busdecoder/cpuif/fanin_gen.py,sha256=Z5OrN3GaPU6yaVJTDOhQ7fNsUTXJMSai9v7jwSng8bc,2671
25
+ peakrdl_busdecoder/cpuif/fanin_intermediate_gen.py,sha256=r-Ffp6wvgZg3DclpuNfKeL-Jp1NSEs3uCfJiJobvlzs,5450
26
26
  peakrdl_busdecoder/cpuif/fanout_gen.py,sha256=-kopGBHC07D9VreygfN0VubHGVVO51og4lAFq6B1oV8,1876
27
27
  peakrdl_busdecoder/cpuif/interface.py,sha256=0xp_4K6DZMGOePbFgLEOIaVemjMS5pnQp7izKmzgu4s,6462
28
28
  peakrdl_busdecoder/cpuif/apb3/__init__.py,sha256=Uq82IJHzlITUvjTuETvPpSzvLEYoairzzPKfPz7kuC4,119
29
29
  peakrdl_busdecoder/cpuif/apb3/apb3_cpuif.py,sha256=1NVcgUY-fT5A9OhHDXkSqtdqCWz5ITdoNgZ4b9Qz0iU,4989
30
30
  peakrdl_busdecoder/cpuif/apb3/apb3_cpuif_flat.py,sha256=VIdHu5bijNnNN7uCCfCFSE2kGp7f3Ouyv5_l1BFVUq8,3233
31
31
  peakrdl_busdecoder/cpuif/apb3/apb3_interface.py,sha256=PQwMtjETR9-c9S1BzjdWieCis2qoOfUyRQAWcD3ScyE,2170
32
- peakrdl_busdecoder/cpuif/apb3/apb3_tmpl.sv,sha256=mxJ55myE0ZeOGW3TTBRmdlUdHq4Yv-6vyHA674S3e3g,1947
32
+ peakrdl_busdecoder/cpuif/apb3/apb3_tmpl.sv,sha256=8ej-_HO9k2MMkKvlXk5i57Zczb8adMko6i8JBL7mDH0,1948
33
33
  peakrdl_busdecoder/cpuif/apb4/__init__.py,sha256=k4JCbIrKGT8hiRvWJDcqc5xx7j9i_xYgpXU70sNaLsc,119
34
34
  peakrdl_busdecoder/cpuif/apb4/apb4_cpuif.py,sha256=JS8-wSmcSXfkyHGzmiyN-G-_5qdvdMwmYxpKn7uQgU4,5199
35
35
  peakrdl_busdecoder/cpuif/apb4/apb4_cpuif_flat.py,sha256=yk80xCLoF9OQE51kkb1CmqVW_eirMoy_KyZ4tkurAh0,3374
36
36
  peakrdl_busdecoder/cpuif/apb4/apb4_interface.py,sha256=dnVWHi1NZScIR7sLYVfxbJDrU-Fm221O1XvHMdpSyi4,2472
37
- peakrdl_busdecoder/cpuif/apb4/apb4_tmpl.sv,sha256=C4ccTQvfpY-JmH9y4lWr8Qbw25OO3_suyjSa_c6XnSY,2001
37
+ peakrdl_busdecoder/cpuif/apb4/apb4_tmpl.sv,sha256=mWxiuW3CWfxxbSLk5AKoogqGZvltKLce_j9swnOiQng,2002
38
38
  peakrdl_busdecoder/cpuif/axi4lite/__init__.py,sha256=5XuWfPK2jDzr6egKUDJFr8l3k3lW-feLIh-lN7Mo8Ks,145
39
- peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif.py,sha256=61Cvj2ndSOns61E0DfTo356k46owuNPSrusqs0FBM70,5770
39
+ peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif.py,sha256=gMByBQ4rWUhOorLSdEjUIdp_f27Ty-H9SJ5QLz12JT0,6353
40
40
  peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_cpuif_flat.py,sha256=gzXmQX15e0OZcYaXDvXNqQhGLqSHM3qkGCs7qk_lNf8,4410
41
41
  peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_interface.py,sha256=EXW-nPJwMF_oCPdJ4XmreiLwhnpqSca9iViosh2rEXM,3721
42
- peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_tmpl.sv,sha256=ketPrq715LSEs8Ar9ecXgnSe2AUAdQ70oNVmDbXc2Tc,3351
42
+ peakrdl_busdecoder/cpuif/axi4lite/axi4_lite_tmpl.sv,sha256=Ybn4eN4YDiecRWbK2oGn45uPbVsXFgpIHVjJN1ZDpkc,3969
43
43
  peakrdl_busdecoder/udps/__init__.py,sha256=gPc74OMVWTIr5vgtFArzbhEyi1OYjllR3ZFwHJ8APaY,106
44
- peakrdl_busdecoder-0.6.6.dist-info/licenses/LICENSE,sha256=eAMIGRcnsTDZVr4qelHkJ49Rd_IiDY4_MVHU7N0UWSw,7646
45
- peakrdl_busdecoder-0.6.6.dist-info/METADATA,sha256=NBh_tp01j-ohVg_PgfGhDAqtHCGcA5yZl0yHgTPRZXM,2797
46
- peakrdl_busdecoder-0.6.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
47
- peakrdl_busdecoder-0.6.6.dist-info/entry_points.txt,sha256=7Xzgt-C2F4cQu1kRLpZa0MbXSFFMC1SWEDnZkY0GH7s,73
48
- peakrdl_busdecoder-0.6.6.dist-info/top_level.txt,sha256=ZIYuTsl8cYby4g8tNR_JGzbYYTrG9mqYLSBqnY1Gpmk,19
49
- peakrdl_busdecoder-0.6.6.dist-info/RECORD,,
44
+ peakrdl_busdecoder-0.6.7.dist-info/licenses/LICENSE,sha256=eAMIGRcnsTDZVr4qelHkJ49Rd_IiDY4_MVHU7N0UWSw,7646
45
+ peakrdl_busdecoder-0.6.7.dist-info/METADATA,sha256=kvs6x9WKSfxv8oBspcedzbNYkQt61vxe8VNRl0YrYkc,2797
46
+ peakrdl_busdecoder-0.6.7.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
47
+ peakrdl_busdecoder-0.6.7.dist-info/entry_points.txt,sha256=7Xzgt-C2F4cQu1kRLpZa0MbXSFFMC1SWEDnZkY0GH7s,73
48
+ peakrdl_busdecoder-0.6.7.dist-info/top_level.txt,sha256=ZIYuTsl8cYby4g8tNR_JGzbYYTrG9mqYLSBqnY1Gpmk,19
49
+ peakrdl_busdecoder-0.6.7.dist-info/RECORD,,