Skip to content

Commit 8ed192c

Browse files
micprogManuel Eggimannluca-valente
authored
Fix bender, add xilinx pads (#16)
* Add override targets to Bender.yml * Patch Bender file for fpga target. Looks like `not(synthesys)` automatically overrides the `fpga` target. To have the xilinx-specific cells linked by Bender to Vivado, we need to modify `synthesis` into `asic`. Fixed typo in sram cells. * Fix bender fpga files, add pad_functional_xilinx * remove unneeded files Co-authored-by: Manuel Eggimann <[email protected]> Co-authored-by: Luca Valente <[email protected]>
1 parent 68cfe64 commit 8ed192c

File tree

6 files changed

+68
-171
lines changed

6 files changed

+68
-171
lines changed

Bender.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,40 @@ dependencies:
66
common_verification: { git: "https://github.com/pulp-platform/common_verification.git", version: 0.2.0 }
77

88
sources:
9-
# These simply wrap tc_* cells and are fine to use in any case
10-
- src/deprecated/cluster_clk_cells.sv
11-
- src/deprecated/pulp_clk_cells.sv
12-
13-
- target: all(rtl, not(synthesis))
9+
- target: all(any(all(not(asic), not(fpga)), tech_cells_generic_include_tc_sram), not(tech_cells_generic_exclude_tc_sram))
1410
files:
15-
# level 0
11+
# Level 0
1612
- src/rtl/tc_sram.sv
1713

18-
- target: all(all(fpga, xilinx), not(synthesis))
19-
files:
20-
- src/deprecated/cluster_clk_cells_xilinx.sv
21-
- src/deprecated/pulp_clk_cells_xilinx.sv
22-
- src/fpga/tc_clk_xilinx.sv
23-
- src/fpga/tc_sram_xilinx.sv
24-
25-
- target: all(not(all(fpga, xilinx)), not(synthesis))
14+
- target: all(any(all(not(asic), not(fpga)), tech_cells_generic_include_tc_clk), not(tech_cells_generic_exclude_tc_clk))
2615
files:
2716
# Level 0
2817
- src/rtl/tc_clk.sv
2918

30-
- target: not(synthesis)
19+
- target: all(any(fpga, tech_cells_generic_include_xilinx_xpm), not(tech_cells_generic_exclude_xilinx_xpm))
20+
files:
21+
- src/fpga/pad_functional_xilinx.sv
22+
- src/fpga/tc_clk_xilinx.sv
23+
- src/fpga/tc_sram_xilinx.sv
24+
25+
- target: all(any(not(synthesis), tech_cells_generic_include_deprecated), not(tech_cells_generic_exclude_deprecated))
3126
files:
3227
- src/deprecated/cluster_pwr_cells.sv
3328
- src/deprecated/generic_memory.sv
3429
- src/deprecated/generic_rom.sv
3530
- src/deprecated/pad_functional.sv
3631
- src/deprecated/pulp_buffer.sv
3732
- src/deprecated/pulp_pwr_cells.sv
33+
34+
- target: all(any(not(synthesis), tech_cells_generic_include_pwr_cells), not(tech_cells_generic_exclude_pwr_cells))
35+
files:
3836
- src/tc_pwr.sv
3937

40-
- target: test
38+
- target: all(any(test, tech_cells_generic_include_tb_cells), not(tech_cells_generic_exclude_tb_cells))
4139
files:
4240
- test/tb_tc_sram.sv
4341
- src/deprecated/pulp_clock_gating_async.sv
42+
43+
# These simply wrap tc_* cells and are fine to use in any case
44+
- src/deprecated/cluster_clk_cells.sv
45+
- src/deprecated/pulp_clk_cells.sv

src/deprecated/cluster_clk_cells_xilinx.sv

Lines changed: 0 additions & 75 deletions
This file was deleted.

src/deprecated/pulp_clk_cells_xilinx.sv

Lines changed: 0 additions & 78 deletions
This file was deleted.

src/fpga/pad_functional_xilinx.sv

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2018 ETH Zurich and University of Bologna.
2+
// Copyright and related rights are licensed under the Solderpad Hardware
3+
// License, Version 0.51 (the "License"); you may not use this file except in
4+
// compliance with the License. You may obtain a copy of the License at
5+
// http://solderpad.org/licenses/SHL-0.51. Unless required by applicable law
6+
// or agreed to in writing, software, hardware and materials distributed under
7+
// this License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
8+
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
9+
// specific language governing permissions and limitations under the License.
10+
11+
12+
module pad_functional_pd
13+
(
14+
input logic OEN,
15+
input logic I,
16+
output logic O,
17+
input logic PEN,
18+
inout logic PAD
19+
);
20+
21+
(* PULLDOWN = "YES" *)
22+
IOBUF iobuf_i (
23+
.T ( OEN ),
24+
.I ( I ),
25+
.O ( O ),
26+
.IO( PAD )
27+
);
28+
29+
endmodule
30+
31+
module pad_functional_pu
32+
(
33+
input logic OEN,
34+
input logic I,
35+
output logic O,
36+
input logic PEN,
37+
inout logic PAD
38+
);
39+
40+
(* PULLUP = "YES" *)
41+
IOBUF iobuf_i (
42+
.T ( OEN ),
43+
.I ( I ),
44+
.O ( O ),
45+
.IO( PAD )
46+
);
47+
48+
endmodule

src/fpga/tc_sram_xilinx.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module tc_sram #(
168168
// Validate parameters.
169169
// pragma translate_off
170170
`ifndef VERILATOR
171-
`ifndef TARGET_SYNTHESYS
171+
`ifndef TARGET_SYNTHESIS
172172
initial begin: p_assertions
173173
assert (SimInit == "zeros") else $fatal(1, "The Xilinx `tc_sram` has fixed SimInit: zeros");
174174
assert ($bits(addr_i) == NumPorts * AddrWidth) else $fatal(1, "AddrWidth problem on `addr_i`");

src/rtl/tc_sram.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module tc_sram #(
167167
// Validate parameters.
168168
// pragma translate_off
169169
`ifndef VERILATOR
170-
`ifndef TARGET_SYNTHESYS
170+
`ifndef TARGET_SYNTHESIS
171171
initial begin: p_assertions
172172
assert ($bits(addr_i) == NumPorts * AddrWidth) else $fatal(1, "AddrWidth problem on `addr_i`");
173173
assert ($bits(wdata_i) == NumPorts * DataWidth) else $fatal(1, "DataWidth problem on `wdata_i`");

0 commit comments

Comments
 (0)