Skip to content

Commit b4070d7

Browse files
gautschimiRazer6
authored andcommitted
[hw/prim] Add technology specific prim implementation
Adds standard cell instances for ASAP7, an open-source standard cell library, to the basic prim instances. Each standard cell instance name starts with "u_size_only_" which is used in the synthesis script to apply constraints to the standard cells to prevent logic optimization. Signed-off-by: Michael Gautschi <[email protected]>
1 parent 61ee5a6 commit b4070d7

30 files changed

+893
-0
lines changed

hw/ip/prim_asap7/BUILD

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright lowRISC contributors (OpenTitan project).
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
filegroup(
8+
name = "rtl_files",
9+
srcs = glob(
10+
["**"],
11+
exclude = [
12+
"dv/**",
13+
"doc/**",
14+
"README.md",
15+
],
16+
) + [
17+
],
18+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright lowRISC contributors (OpenTitan project).
2+
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
`verilator_config
7+
8+
lint_off -rule UNUSED -file "*/rtl/prim_clock_buf.sv" -match "Parameter is not used: 'NoFpgaBuf'"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright lowRISC contributors (OpenTitan project).
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# primitives: prim_clock_buf
6+
waive -rules PARAM_NOT_USED -location {prim_clock_buf.sv} -regexp {Parameter '(NoFpgaBuf|RegionSel)' not used} \
7+
-comment "parameter unused but required to maintain uniform interface"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright lowRISC contributors (OpenTitan project).
2+
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
`verilator_config
7+
8+
lint_off -rule UNUSED -file "*/rtl/prim_clock_inv.sv" -match "Parameter is not used: 'NoFpgaGate|FpgaBufGlobal'"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright lowRISC contributors (OpenTitan project).
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# primitives: prim_clock_buf
6+
waive -rules PARAM_NOT_USED -location {prim_clock_gating.sv} -regexp {Parameter '(NoFpgaGate|FpgaBufGlobal)' not used} \
7+
-comment "parameter unused but required to maintain uniform interface"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright lowRISC contributors (OpenTitan project).
2+
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
// SPDX-License-Identifier: Apache-2.0
4+
//
5+
6+
`verilator_config
7+
8+
lint_off -rule UNUSED -file "*/rtl/prim_clock_inv.sv" -match "Parameter is not used: 'HasScanMode|NoFpgaBufG'"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright lowRISC contributors (OpenTitan project).
2+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# primitives: prim_clock_buf
6+
waive -rules PARAM_NOT_USED -location {prim_clock_inv.sv} -regexp {Parameter '(HasScanMode|NoFpgaBufG)' not used} \
7+
-comment "parameter unused but required to maintain uniform interface"

hw/ip/prim_asap7/prim_asap7.core

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
CAPI=2:
2+
# Copyright lowRISC contributors (OpenTitan project).
3+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
name: "lowrisc:prim_asap7:all"
7+
description: "OpenSource ASAP7 prim standard cell library: prim_asap7:* modules directly
8+
instantiate standard cells. Memories and pad cells are not available and map to
9+
generic implementations"
10+
11+
filesets:
12+
files_rtl:
13+
depend:
14+
- lowrisc:prim_asap7:and2
15+
- lowrisc:prim_asap7:buf
16+
- lowrisc:prim_asap7:clock_buf
17+
- lowrisc:prim_generic:clock_div
18+
- lowrisc:prim_asap7:clock_gating
19+
- lowrisc:prim_asap7:clock_inv
20+
- lowrisc:prim_asap7:clock_mux2
21+
- lowrisc:prim_asap7:flop
22+
- lowrisc:prim_generic:flop_2sync
23+
- lowrisc:prim_asap7:flop_en
24+
- lowrisc:prim_generic:pad_attr
25+
- lowrisc:prim_generic:pad_wrapper
26+
- lowrisc:prim_generic:ram_1p
27+
- lowrisc:prim_generic:ram_1r1w
28+
- lowrisc:prim_generic:ram_2p
29+
- lowrisc:prim_generic:rom
30+
- lowrisc:prim_generic:usb_diff_rx
31+
- lowrisc:prim_asap7:xnor2
32+
- lowrisc:prim_asap7:xor2
33+
- lowrisc:prim_asap7:flop_no_rst
34+
# Note that flash is a macro that depends on IPs, so they are not
35+
# included here. They must be brought in explicitly.
36+
# - lowrisc:prim_generic:flash
37+
38+
mapping:
39+
"lowrisc:prim:and2" : "lowrisc:prim_asap7:and2"
40+
"lowrisc:prim:buf" : "lowrisc:prim_asap7:buf"
41+
"lowrisc:prim:clock_buf" : "lowrisc:prim_asap7:clock_buf"
42+
"lowrisc:prim:clock_div" : "lowrisc:prim_generic:clock_div"
43+
"lowrisc:prim:clock_gating" : "lowrisc:prim_asap7:clock_gating"
44+
"lowrisc:prim:clock_inv" : "lowrisc:prim_asap7:clock_inv"
45+
"lowrisc:prim:clock_mux2" : "lowrisc:prim_asap7:clock_mux2"
46+
"lowrisc:prim:flop" : "lowrisc:prim_asap7:flop"
47+
"lowrisc:prim:flop_2sync" : "lowrisc:prim_generic:flop_2sync"
48+
"lowrisc:prim:flop_en" : "lowrisc:prim_asap7:flop_en"
49+
"lowrisc:prim:pad_attr" : "lowrisc:prim_generic:pad_attr"
50+
"lowrisc:prim:pad_wrapper" : "lowrisc:prim_generic:pad_wrapper"
51+
"lowrisc:prim:ram_1p" : "lowrisc:prim_generic:ram_1p"
52+
"lowrisc:prim:ram_1r1w" : "lowrisc:prim_generic:ram_1r1w"
53+
"lowrisc:prim:ram_2p" : "lowrisc:prim_generic:ram_2p"
54+
"lowrisc:prim:rom" : "lowrisc:prim_generic:rom"
55+
"lowrisc:prim:usb_diff_rx" : "lowrisc:prim_generic:usb_diff_rx"
56+
"lowrisc:prim:xnor2" : "lowrisc:prim_asap7:xnor2"
57+
"lowrisc:prim:xor2" : "lowrisc:prim_asap7:xor2"
58+
"lowrisc:prim:flop_no_rst" : "lowrisc:prim_asap7:flop_no_rst"
59+
# Flash is a good canditate to be removed from the prims and become a macro like OTP.
60+
# TODO(#27042): When this is done, it should be removed from this mapping.
61+
"lowrisc:prim:flash": "lowrisc:prim_generic:flash"
62+
63+
targets:
64+
default:
65+
filesets:
66+
- files_rtl
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
CAPI=2:
2+
# Copyright lowRISC contributors (OpenTitan project).
3+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
name: "lowrisc:prim_asap7:and2"
7+
description: "asap7 instance of a 2-input and gate"
8+
virtual:
9+
- lowrisc:prim:and2
10+
11+
filesets:
12+
files_rtl:
13+
files:
14+
- rtl/prim_and2.sv
15+
file_type: systemVerilogSource
16+
17+
files_verilator_waiver:
18+
depend:
19+
# common waivers
20+
- lowrisc:lint:common
21+
22+
files_ascentlint_waiver:
23+
depend:
24+
# common waivers
25+
- lowrisc:lint:common
26+
27+
files_veriblelint_waiver:
28+
depend:
29+
# common waivers
30+
- lowrisc:lint:common
31+
32+
targets:
33+
default:
34+
filesets:
35+
- tool_verilator ? (files_verilator_waiver)
36+
- tool_ascentlint ? (files_ascentlint_waiver)
37+
- tool_veriblelint ? (files_veriblelint_waiver)
38+
- files_rtl
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
CAPI=2:
2+
# Copyright lowRISC contributors (OpenTitan project).
3+
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
name: "lowrisc:prim_asap7:buf"
7+
description: "asap7 instance of a buffer"
8+
virtual:
9+
- lowrisc:prim:buf
10+
11+
filesets:
12+
files_rtl:
13+
files:
14+
- rtl/prim_buf.sv
15+
file_type: systemVerilogSource
16+
17+
files_verilator_waiver:
18+
depend:
19+
# common waivers
20+
- lowrisc:lint:common
21+
22+
files_ascentlint_waiver:
23+
depend:
24+
# common waivers
25+
- lowrisc:lint:common
26+
27+
files_veriblelint_waiver:
28+
depend:
29+
# common waivers
30+
- lowrisc:lint:common
31+
32+
targets:
33+
default:
34+
filesets:
35+
- tool_verilator ? (files_verilator_waiver)
36+
- tool_ascentlint ? (files_ascentlint_waiver)
37+
- tool_veriblelint ? (files_veriblelint_waiver)
38+
- files_rtl

0 commit comments

Comments
 (0)