W4.5.1 Supply Sets for Two Domains

MediumImplementOpenPA + Icarus · serverReview the topic

Group the nets of media into supply sets, one per supply, and give each power domain its set through its primary handle.

Hardware context: The same radio, its supplies bundled into supply sets with an n-well bias on the RF block. Name each supply once as a set, hand it to domains and strategies through handles, and check that a rewrite keeps the intent.

The design media has an always-on top, a core and a DSP. The domains, supply ports, nets and unit switches are given in media_rails.upf. The isolation is in media_iso.upf, which powers its clamps from a set named SS_AON.

Nobody has told the domains which supply powers them. You write that part, with supply sets only: no net-by-net primary supply.

The core also has an n-well bias rail, VNW. It belongs to the core's supply set as a bias function.

Full specification
Supply setpowergroundBiasPowers
SS_AONVDD_NVSS_NnonePD_TOP, and the isolation clamps
SS_COREVDD_COREVSS_Nnwell: VNW_NPD_CORE
SS_DSPVDD_DSPVSS_NnonePD_DSP
RuleWhat the grader checks
Supply sets onlyThe file makes supply sets and uses no set_domain_supply_net.
Complete setsEach set has its power and its ground function. The static report must not warn about a missing ground.
The right handleEach domain's primary handle gets the set in the table. The bench reads PD_CORE.primary.power and PD_DSP.primary.power.
The core's biasThe static report shows the n-well bias VNW_N on the core's set, and on no other set.
The isolation supplymedia_iso.upf is loaded and finds SS_AON.
The scenarios passA public run and two hidden switch sequences print the expected rail states and values.

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 units run, then the DSP is switched offpublic scenario: Run shows it
The core is switched off while the DSP runshidden scenario
Both units off, then the core back after a resethidden 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
UPF formsno set_domain_supply_net; uses create_supply_set SS_AON; uses create_supply_set SS_CORE; uses create_supply_set SS_DSP
Static reportno forbidden finding

The Design

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

media.sv
// media: an always-on top with a core and a DSP. Power-unaware RTL.
module media (
  input  logic       clk,
  input  logic       rst_n,
  input  logic       en,
  input  logic [7:0] d,
  input  logic       pwr_core,
  input  logic       pwr_dsp,
  input  logic       iso_core,
  input  logic       iso_dsp,
  output logic [7:0] q_core,
  output logic [7:0] q_dsp,
  output logic [7:0] ticks,
  output logic [7:0] total
);
  core u_core (.clk(clk), .rst_n(rst_n), .en(en), .d(d), .q(q_core), .ticks(ticks));
  dsp  u_dsp  (.clk(clk), .rst_n(rst_n), .en(en), .d(d), .q(q_dsp));
  always_ff @(posedge clk or negedge rst_n)
    if (!rst_n) total <= '0;
    else        total <= q_core + q_dsp;
endmodule
core.sv
// core: an accumulator and a watchdog tick counter.
module core (
  input  logic       clk,
  input  logic       rst_n,
  input  logic       en,
  input  logic [7:0] d,
  output logic [7:0] q,
  output logic [7:0] ticks
);
  acc  u_alu (.clk(clk), .rst_n(rst_n), .en(en), .d(d), .q(q));
  tick u_wdt (.clk(clk), .rst_n(rst_n), .q(ticks));
endmodule
dsp.sv
// dsp: one accumulator fed with d + 1.
module dsp (
  input  logic       clk,
  input  logic       rst_n,
  input  logic       en,
  input  logic [7:0] d,
  output logic [7:0] q
);
  acc u_mac (.clk(clk), .rst_n(rst_n), .en(en), .d(d + 8'd1), .q(q));
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
tick.sv
// tick: counts every clock edge.
module tick (
  input  logic       clk,
  input  logic       rst_n,
  output logic [7:0] q
);
  always_ff @(posedge clk or negedge rst_n)
    if (!rst_n) q <= '0;
    else        q <= q + 8'd1;
endmodule

Given UPF Files

Your file may load these with load_upf. The grader uses the same text.

media_rails.upf
# media_rails.upf: the domains, supply ports, nets and switches of media (given).
create_power_domain PD_TOP -elements {.}
create_power_domain PD_CORE -elements {u_core}
create_power_domain PD_DSP -elements {u_dsp}

create_supply_port VDD -direction in
create_supply_port VSS -direction in
create_supply_port VNW -direction in
create_supply_net VDD_N
create_supply_net VSS_N
create_supply_net VNW_N
create_supply_net VDD_CORE
create_supply_net VDD_DSP
connect_supply_net VDD_N -ports {VDD}
connect_supply_net VSS_N -ports {VSS}
connect_supply_net VNW_N -ports {VNW}

# The unit switches, each from the always-on net
create_power_switch SW_CORE -domain PD_TOP -input_supply_port {i VDD_N} -output_supply_port {o VDD_CORE} \
    -control_port {c pwr_core} -on_state {on i {c}} -off_state {off {!c}}
create_power_switch SW_DSP -domain PD_TOP -input_supply_port {i VDD_N} -output_supply_port {o VDD_DSP} \
    -control_port {c pwr_dsp} -on_state {on i {c}} -off_state {off {!c}}
media_iso.upf
# media_iso.upf: isolation of the core and the DSP (given). The clamps are powered by SS_AON.
set_isolation ISO_CORE -domain PD_CORE -applies_to outputs -clamp_value 0 \
    -isolation_supply SS_AON -isolation_signal iso_core -isolation_sense high -location parent
set_isolation ISO_DSP -domain PD_DSP -applies_to outputs -clamp_value 0 \
    -isolation_supply SS_AON -isolation_signal iso_dsp -isolation_sense high -location parent

The Public Scenario

Both units run, then the DSP is switched 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_core = 1, pwr_dsp = 1, iso_core = 0, iso_dsp = 0;
  logic [7:0] d = 0;
  wire [7:0] q_core, q_dsp, ticks, total;
  media 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 core=%-17s dsp=%-17s q_core=%0h q_dsp=%0h total=%0h", what,
             rail("PD_CORE.primary.power"), rail("PD_DSP.primary.power"), q_core, q_dsp, 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));
    @(posedge clk); #1 rst_n = 1;
    beat(8'h10); show("both on");
    iso_dsp = 1; #1 pwr_dsp = 0; #1 show("dsp off");
    beat(8'h01); show("core runs");
    #20 $finish;
  end
endmodule

Examples

Example 1

The Starter
Input
The starter, with the given media_rails.upf and media_iso.upf
OpenPA says (recorded)
Refused: media_iso.upf:3: set_isolation ISO_CORE (domain PD_CORE): no supply set "SS_AON"

The isolation file names a supply set that your file has not made yet. OpenPA stops at that line.

Example 2

Domains with No Supply Set
Input
The starter without its media_iso.upf line, read by OpenPA (its domains)
OpenPA reports (recorded)
Power domains
    primary supply PD_TOP.primary: power PD_TOP.primary.power, ground PD_TOP.primary.ground
    primary supply PD_CORE.primary: power PD_CORE.primary.power, ground PD_CORE.primary.ground
    primary supply PD_DSP.primary: power PD_DSP.primary.power, ground PD_DSP.primary.ground

Each domain still has its primary handle, but nothing is tied to it. OpenPA gives each handle anonymous nets, which no bench line drives.

Example 3

The Sample Run: Both Units Run, Then the DSP Is Switched Off
Input
The reference file, run on the public scenario
The bench prints (recorded)
both on   core=FULL_ON 1000 mV   dsp=FULL_ON 1000 mV   q_core=10 q_dsp=11 total=0
dsp off   core=FULL_ON 1000 mV   dsp=OFF 0 mV          q_core=10 q_dsp=0 total=0
core runs core=FULL_ON 1000 mV   dsp=OFF 0 mV          q_core=11 q_dsp=0 total=10

Both units run. The DSP is switched off with iso_dsp raised first. Its rail reads OFF and q_dsp the clamp value 0, while the core keeps adding.

Constraints and Contract

  • Preserve the given supply wiring and isolation placement. Add no extra supply nets or ports. No supply net may lack a source.
  • Submit the whole UPF file for media. Keep the two load_upf lines: media_rails.upf first, media_iso.upf last.
  • Create each set before a command uses it. Name the sets as the table does.
  • The bench drives the ports VDD and VSS, the switch controls and the isolation enables. It never drives VNW: OpenPA records a bias function but does not simulate it.

Hints

Hint 1

A supply set lists its nets with one -function option per function: power, ground, or a bias function.

Hint 2

Every domain has a predefined handle, primary. associate_supply_set ties a set to it.

Hint 3

If a domain never comes on in the public run, check that its set has both power and ground.

What the grader checks: OpenPA reads your file and the two given files. The grader checks the forms of the commands you used and the static report for the bias. It compares the domains, supply sets, primary supplies and isolation with the reference. Then it runs a public and two hidden switch sequences.

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