Skip to content

Commit 23182a3

Browse files
authored
Add tc_clk_or2 (#27)
... and add warning about tc_clk_mux2 usage * Add clk OR cell * Add usage warning to clock mux cell * Update changelog
1 parent aef525b commit 23182a3

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## Unreleased
8+
### Added
9+
- `tc_clk_or2`: A new generic tech cell for balanced clock OR-gates.
10+
- Added warning about misusing `tc_clk_mux2` cells.
811

912
## 0.2.10 - 2022-11-20
1013
### Added

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ If you want to get started in your own technology (either an unsupported FPGA or
1919

2020
Clock cells usually are care-fully designed cells which do not exhibit any glitches. Therefore they need to be manually instantiated in ASIC designs. All clock cells can be found in `tc_clk.sv`.
2121

22-
| Name | Description | Status | Xilinx |
22+
| Name | Description | Status | Xilinx |
2323
|-------------------|------------------------------|--------|--------------------|
2424
| `tc_clk_and2` | Clock and gate | active | :white_check_mark: |
2525
| `tc_clk_buffer` | Clock buffer | active | :white_check_mark: |
2626
| `tc_clk_gating` | Integrated clock gating cell | active | :white_check_mark: |
2727
| `tc_clk_inverter` | Clock inverter | active | :white_check_mark: |
2828
| `tc_clk_mux2` | Clock Mux with two inputs | active | :white_check_mark: |
2929
| `tc_clk_xor2` | Clock Xor | active | :white_check_mark: |
30+
| `tc_clk_or2` | Clock Or | active | :white_check_mark: |
3031
| `tc_clk_delay` | Programmable clock-delay | active | |
3132

3233
### Memory

src/fpga/tc_clk_xilinx.sv

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,14 @@ module tc_clk_xor2 (
8383

8484
endmodule
8585

86+
module tc_clk_or2 (
87+
input logic clk0_i,
88+
input logic clk1_i,
89+
output logic clk_o
90+
);
91+
92+
assign clk_o = clk0_i | clk1_i;
93+
94+
endmodule
95+
96+

src/rtl/tc_clk.sv

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,16 @@ module tc_clk_inverter (
6161

6262
endmodule
6363

64+
// Warning: Typical clock mux cells of a technologies std cell library ARE NOT
65+
// GLITCH FREE!! The only difference to a regular multiplexer cell is that they
66+
// feature balanced rise- and fall-times. In other words: SWITCHING FROM ONE
67+
// CLOCK TO THE OTHER CAN INTRODUCE GLITCHES. ALSO, GLITCHES ON THE SELECT LINE
68+
// DIRECTLY TRANSLATE TO GLITCHES ON THE OUTPUT CLOCK!! This cell is only
69+
// intended to be used for quasi-static switching between clocks when one of the
70+
// clocks is anyway inactive or if the downstream logic remains gated or in
71+
// reset state during the transition phase. If you need dynamic switching
72+
// between arbitrary input clocks without introducing glitches, have a look at
73+
// the clk_mux_glitch_free cell in the pulp-platform/common_cells repository.
6474
module tc_clk_mux2 (
6575
input logic clk0_i,
6676
input logic clk1_i,
@@ -82,6 +92,16 @@ module tc_clk_xor2 (
8292

8393
endmodule
8494

95+
module tc_clk_or2 (
96+
input logic clk0_i,
97+
input logic clk1_i,
98+
output logic clk_o
99+
);
100+
101+
assign clk_o = clk0_i | clk1_i;
102+
103+
endmodule
104+
85105
`ifndef SYNTHESIS
86106
module tc_clk_delay #(
87107
parameter int unsigned Delay = 300ps
@@ -98,5 +118,3 @@ module tc_clk_delay #(
98118

99119
endmodule
100120
`endif
101-
102-

0 commit comments

Comments
 (0)