Skip to content

Commit

Permalink
[WIP] rtl: Model the power distributing using USE_POWER_PINS define
Browse files Browse the repository at this point in the history
This is actually not helping anything, just mostly for future use
if we can get rid of the custom odb script.

Signed-off-by: Sylvain Munaut <[email protected]>
  • Loading branch information
smunaut committed Oct 15, 2023
1 parent 0770e3b commit 4711d66
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ol2/tt_top/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ class TopFlow(SequentialFlow):
"../../rtl/tt_user_module.v",
],

"VERILOG_POWER_DEFINE": "USE_POWER_PINS",

# Macros
"EXTRA_VERILOG_MODELS": macros_models,
"MACROS": macros,
Expand Down
4 changes: 4 additions & 0 deletions ol2/tt_top/user_project_wrapper.v
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ module user_project_wrapper (

// Main core
tt_top top_I (
`ifdef USE_POWER_PINS
.VPWR (vccd1),
.VGND (vssd1),
`endif
.io_ana (io_ana),
.io_in (io_in),
.io_out (io_out),
Expand Down
22 changes: 22 additions & 0 deletions rtl/tt_top.v
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module tt_top #(
parameter integer N_O = `TT_N_O,
parameter integer N_I = `TT_N_I
)(
// Power
`ifdef USE_POWER_PINS
input wire VPWR,
input wire VGND,
`endif

// IOs
inout wire [N_PADS-1:0] io_ana,
input wire [N_PADS-1:0] io_in,
Expand Down Expand Up @@ -140,6 +146,10 @@ module tt_top #(
)
`endif
ctrl_I (
`ifdef USE_POWER_PINS
.VPWR (VPWR),
.VGND (VGND),
`endif
.pad_uio_in (pad_uio_in),
.pad_uio_out (pad_uio_out),
.pad_uio_oe_n (pad_uio_oe_n),
Expand Down Expand Up @@ -187,6 +197,10 @@ module tt_top #(
)
`endif
mux_I (
`ifdef USE_POWER_PINS
.VPWR (VPWR),
.VGND (VGND),
`endif
.um_ow (l_um_ow),
.um_iw (l_um_iw),
.um_ena (l_um_ena),
Expand Down Expand Up @@ -218,6 +232,10 @@ module tt_top #(
.N_O (N_O),
.N_IO (N_IO)
) um_bot_I (
`ifdef USE_POWER_PINS
.VPWR (VPWR),
.VGND (VGND),
`endif
.ana (l_um_ana[(j*2+0)*N_A+:N_A]),
.ow (l_um_ow[(j*2+0)*U_OW+:U_OW]),
.iw (l_um_iw[(j*2+0)*U_IW+:U_IW]),
Expand All @@ -235,6 +253,10 @@ module tt_top #(
.N_O (N_O),
.N_IO (N_IO)
) um_top_I (
`ifdef USE_POWER_PINS
.VPWR (VPWR),
.VGND (VGND),
`endif
.ana (l_um_ana[(j*2+1)*N_A+:N_A]),
.ow (l_um_ow[(j*2+1)*U_OW+:U_OW]),
.iw (l_um_iw[(j*2+1)*U_IW+:U_IW]),
Expand Down
20 changes: 20 additions & 0 deletions rtl/tt_user_module.v.mak
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ module tt_user_module #(
parameter integer N_OW = N_O + N_IO * 2 ,
parameter integer N_IW = N_I + N_IO
)(
`ifdef USE_POWER_PINS
input wire VPWR,
input wire VGND,
`endif
inout wire [N_A-1:0] ana,
output wire [N_OW-1:0] ow,
input wire [N_IW-1:0] iw,
Expand All @@ -50,7 +54,14 @@ module tt_user_module #(
% for (px,py), mod in grid.items():
if ((POS_Y == ${py}) && (POS_X == ${px}))
begin : block_${py}_${px}
`ifdef USE_POWER_PINS
wire l_vpwr;
`endif
tt_um_${mod.name} tt_um_I (
`ifdef USE_POWER_PINS
.VPWR (l_vpwr),
.VGND (VGND),
`endif
% if mod.analog:
.ua (ana),
% endif
Expand All @@ -65,8 +76,17 @@ module tt_user_module #(
);
% if mod.pg_vdd:
tt_pg_vdd_${mod.height} tt_pg_vdd_I (
`ifdef USE_POWER_PINS
.GPWR (l_vpwr),
.VPWR (VPWR),
.VGND (VGND),
`endif
.ctrl (pg_vdd)
);
% else:
`ifdef USE_POWER_PINS
assign l_vpwr = VPWR;
`endif
% endif
end
% endfor
Expand Down

0 comments on commit 4711d66

Please sign in to comment.