W4.4.2 Parallel Regulators and Legacy Primaries

MediumFixOpenPA + Icarus · serverReview the topic

A graphics block's supply file has four defects in its ports, nets and primaries. Find each one from the tool's messages and the rail states.

Hardware context: A radio with a two-regulator RF rail and a two-switch baseband rail. Wire supply ports and nets, and pick the resolution that matches how the sources take turns.

The design gfx has a shader and a texture unit. The shader rail VDD_SH is fed by two switch banks, left and right, in parallel. Both banks take their input from the main supply, as the switch ring does on the chip. The texture rail comes through one switch from an auxiliary supply, VAUX, which enters the chip at its own pin.

The file below came from the previous owner. It has four defects. One is refused by OpenPA once another is fixed. One shows up as wrong rail states in a run. Two show up only as warnings in the static report.

Fix the file so that it describes the network in the tables. Keep every command; change only what is wrong.

Full specification
RailSourcesWhat its state must be
VDD_SHSW_L and SW_R, both fed from VDD_NFULL_ON with both banks on; PARTIAL_ON with one; OFF with none
VDD_TEXSW_TEX, fed from VAUX_Nthe state of VAUX while the switch is on
RuleWhat the grader checks
Port directionsVAUX brings a supply into the chip. The static report must not warn about a net with no source.
The right resolutionThe shader rail resolves two sources that share one root, by IEEE 1801-2024 6.25.3.
One root for parallel sourcesBoth banks are fed from the main supply. The switches equal the reference's.
Complete primariesEvery domain has a primary power and a primary ground net; the static report must not warn about a missing one.
The scenarios passA public run, and two hidden runs with their expected rail states and check counts.

What the Grader Checks

OpenPA reads your file. A refusal ends the check with OpenPA's message and line. Otherwise every row below must pass.

RowRule
Both shader banks on, then the left one offpublic scenario: Run shows it
Power up with one bank, then add the otherhidden scenario
The auxiliary supply drops while the texture switch is onhidden scenario
Intent equals the referencethe domain of every instance; supply sets and switches; the primary supply of every domain; isolation cells (clamp, enable, sense, supply); where each isolation cell is placed; supply ports, nets and their connections
Static reportno forbidden finding

The Design

The power-unaware RTL your UPF describes (top gfx). Open a file to read it.

gfx.sv
// gfx: an always-on top with a shader and a texture unit. Power-unaware RTL.
module gfx (
  input  logic       clk,
  input  logic       rst_n,
  input  logic       en,
  input  logic [7:0] d,
  input  logic       pwr_l,
  input  logic       pwr_r,
  input  logic       pwr_tex,
  input  logic       iso_sh,
  input  logic       iso_tex,
  output logic [7:0] q_sh,
  output logic [7:0] q_tex,
  output logic [7:0] total
);
  acc u_shader (.clk(clk), .rst_n(rst_n), .en(en), .d(d),        .q(q_sh));
  acc u_tex    (.clk(clk), .rst_n(rst_n), .en(en), .d(d + 8'd2), .q(q_tex));
  always_ff @(posedge clk or negedge rst_n)
    if (!rst_n) total <= '0;
    else        total <= q_sh + q_tex;
endmodule
acc.sv
// acc: an 8-bit accumulator.
module acc (
  input  logic       clk,
  input  logic       rst_n,
  input  logic       en,
  input  logic [7:0] d,
  output logic [7:0] q
);
  always_ff @(posedge clk or negedge rst_n)
    if (!rst_n)  q <= '0;
    else if (en) q <= q + d;
endmodule

The Public Scenario

Both shader banks on, then the left one off. Run checks its output and shows the expected lines and any failure.

tb.sv (public scenario)
`timescale 1ns/1ps
module tb;
  import UPF::*;
  logic clk = 0, rst_n = 0, en = 0, pwr_l = 1, pwr_r = 1, pwr_tex = 1, iso_sh = 0, iso_tex = 0;
  logic [7:0] d = 0;
  wire [7:0] q_sh, q_tex, total;
  gfx dut (.*);
  always #5 clk = ~clk;
  function automatic string rail(string net);
    upfSupplyTypeT v; upfSupplyStateE s;
    v = get_supply_value(net); s = get_supply_state(v);
    return $sformatf("%s %0d mV", s.name(), $rtoi(get_supply_voltage(v) * 1000.0));
  endfunction
  task show(string what);
    $display("%-9s sh_rail=%-17s tex_rail=%-17s sh=%0h tex=%0h total=%0h", what,
             rail("VDD_SH"), rail("VDD_TEX"), dut.u_shader.q, dut.u_tex.q, total);
  endtask
  task beat(input logic [7:0] x); en = 1; d = x; @(posedge clk); #1 en = 0; endtask
  initial begin
    void'(supply_on("VDD", 1.0));
    void'(supply_on("VSS", 0.0));
    void'(supply_on("VAUX", 1.0));
    @(posedge clk); #1 rst_n = 1;
    beat(8'h10); show("both");
    iso_sh = 1; #1 pwr_l = 0; #1 show("right");
    pwr_r = 0; #1 show("none");
    #20 $finish;
  end
endmodule

Examples

Example 1

The Starter's Supply Network
Input
The starter, read by OpenPA (its supply network)
OpenPA reports (recorded)
Supply network
  VDD_N: port VDD  {port:VDD net:VDD_N sw:SW_L/i fn:PD_TOP.primary.power}
  VSS_N: port VSS  {port:VSS net:VSS_N fn:PD_TOP.primary.ground fn:PD_TEX.primary.ground}
  VAUX_N: root VAUX_N  {port:VAUX net:VAUX_N sw:SW_R/i sw:SW_TEX/i}
  VDD_SH: switch SW_L, switch SW_R (-resolve one_hot)  {net:VDD_SH sw:SW_L/o sw:SW_R/o fn:PD_SH.primary.power}
  VDD_TEX: switch SW_TEX  {net:VDD_TEX sw:SW_TEX/o fn:PD_TEX.primary.power}
  PD_SH.primary.ground: root PD_SH.primary.ground  {fn:PD_SH.primary.ground}

Read where each net gets its state from. One net has no source at all.

Example 2

The Starter's Warnings
Input
The starter, read by OpenPA (its warnings)
OpenPA reports (recorded)
Warnings (2)
  answer.upf:22: create_power_switch SW_R input i: supply net VAUX_N has no source in the UPF (no top-level input supply port or switch output). It is OFF until the bench drives it: supply_on("VAUX", volts) or set_supply_state("VAUX", FULL_ON)
  answer.upf:5: power domain PD_SH: the primary supply has no ground net; only power decides its state

Static warnings point at defects that a run may never show.

Example 3

The Sample Run: Both Shader Banks on, Then the Left One Off
Input
The reference file, run on the public scenario
The bench prints (recorded)
both      sh_rail=FULL_ON 1000 mV   tex_rail=FULL_ON 1000 mV   sh=10 tex=12 total=0
right     sh_rail=PARTIAL_ON 1000 mV tex_rail=FULL_ON 1000 mV   sh=xx tex=12 total=0
none      sh_rail=OFF 0 mV          tex_rail=FULL_ON 1000 mV   sh=xx tex=12 total=0

Both banks are on: the shader rail is FULL_ON. With the left bank off it is PARTIAL_ON, so the shader is corrupted; with none it is OFF.

Constraints and Contract

  • Submit the whole UPF file for gfx. Keep every command of the starter.
  • The bench drives the ports VDD, VSS and VAUX, the switch controls and the isolation enables, and reads VDD_SH and VDD_TEX.

Hints

Hint 1

Read the static report as well as the rail states. Which net has no source in the UPF?

Hint 2

Under IEEE 1801-2024, a one_hot net with two sources on is UNDETERMINED. Two banks that are on together need another resolution.

Hint 3

That resolution has a rule about where its sources come from. Then read the static report's warnings.

What the grader checks: OpenPA reads your file. The grader checks the static report for missing primary nets and checks domains, port directions, wiring, switches, primary supplies and isolation placement. Then it runs a public and two hidden power scenarios, with expected rail states and check counts.

Run checks the public scenario only and never accepts. Submit runs every row. OpenPA is our open power-aware tool: it reads the UPF, writes a power-aware copy of the RTL, and Icarus runs that copy.

See all 2 problems on this path
Your UPF file UPFSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs
Not run yet

Run checks the public scenario. Submit checks every row in the description.

OpenPA + Icarus · server