Files
retroSoC/rtl/tech/gf180_seq_sim_cells.v
T
maksyuki 65c19e7005 feat(hp): replace the OpenC906 clock-gating cells with per-PDK ICGs
Complete the integration manual chapter 3 cell swap (the ICG half; the
SRAM half landed earlier). Three new reviewed overrides, registered in
generate_openc906.py with sha256 pins on the vendored files and added to
the generated-filelist stamp prerequisites:

- gated_clk_cell.v (216 CPU instances) and tdt_gated_clk_cell.v (DTM):
  pass-through upstream by default; with PDK_IHP130/PDK_ICS55/PDK_SKY130/
  PDK_GF180 and without PDK_BEHAV they instantiate the process ICG cell
  (sg13g2_slgcp_1 with SCE, ICGX1H7R with the scan enable ORed into E
  because the ICS55 cell has no TE pin, sky130_fd_sc_hd__sdlclkp_1 with
  SCE, gf180mcu_fd_sc_mcu7t5v0__icgtp_1 with TE and notifier tied off).
- BUFGCE.v (PLIC/CLINT div-2 gate): the upstream behavioral latch model
  stays byte-identical by default; the same four PDK branches substitute
  the process cell with the scan input tied off.

The GF180 branch uses a repo-owned icgtp_1 functional model in
rtl/tech/gf180_seq_sim_cells.v (following the file's dff precedent)
because the vendor functional model references a UDP latch primitive that
the locked gf180mcu-pdk checkout never ships. SKY130 picks up the vendor
sdlclkp model through pdk_sky130.fl, following the existing cell pattern.
ASIC CI profiles with PDK_BEHAV unset now compile real clock gating;
PDK_BEHAV=YES profiles are bit-identical.

Evidence: the manual's MEM_INTF c906_icg_test_tb passes on all four PDK
cell paths (Icarus adaptation); the five-mode boot testbench suite passes
on top of this change.
2026-10-15 14:05:46 +08:00

74 lines
2.5 KiB
Verilog

// Copyright (c) 2026 Yuchi Miao <miaoyuchi@ict.ac.cn>
// retroSoC is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
// You may use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
// Icarus functional models for the sequential GF180 cells selected by Yosys.
// The upstream models expose a timing notifier that the synthesized netlist
// leaves unconnected; these models retain the PDK cell interfaces without
// propagating that high-impedance notifier into functional simulation.
module gf180mcu_fd_sc_mcu7t5v0__dffq_1 (
input wire CLK,
input wire D,
output reg Q,
input wire notifier
);
always @(posedge CLK) Q <= D;
endmodule
module gf180mcu_fd_sc_mcu7t5v0__dffrnq_1 (
input wire CLK,
input wire D,
input wire RN,
output reg Q,
input wire notifier
);
always @(posedge CLK or negedge RN) begin
if (!RN) Q <= 1'b0;
else Q <= D;
end
endmodule
module gf180mcu_fd_sc_mcu7t5v0__dffsnq_1 (
input wire CLK,
input wire D,
input wire SETN,
output reg Q,
input wire notifier
);
always @(posedge CLK or negedge SETN) begin
if (!SETN) Q <= 1'b1;
else Q <= D;
end
endmodule
// The upstream icgtp functional model references a UDP latch primitive
// (UDP_GF018hv5v_mcu_sc7_TT_1P8V_25C_verilog_nonpg_MGM_N_IQ_LATCH_UDP) that
// is not shipped anywhere in the locked GF180 checkout, so the vendor model
// cannot elaborate; this functional model retains the PDK cell interface.
module gf180mcu_fd_sc_mcu7t5v0__icgtp_1 (
input wire TE,
input wire E,
input wire CLK,
output wire Q,
input wire notifier
);
reg s_en_latch;
always @(CLK or E or TE) begin
if (!CLK) s_en_latch <= E | TE;
end
assign Q = CLK & s_en_latch;
endmodule