Store and Rest are both safe destinations. The camera must pass through Stream when moving between them.
Hardware context: A camera with separate pixel and buffer supplies. Preserve allowed rail pairs and reject forbidden changes between modes.
Store and Rest are both safe destinations. The camera must pass through Stream when moving between them.
Complete the UPF for sensor_hub. The board file supplies the wiring. The camera input grab drives the output request.
Full specification
| Decision | Required behavior |
|---|---|
| Endpoints | Preserve all three legal HUB states. |
| Drain | Use the compatibility command describe_state_transition on HUB for drain. |
| Drain direction | Forbid direct Store to Rest. |
| Start | Use the same compatibility form for start. |
| Start direction | Forbid direct Rest to Store. |
| Through Stream | Allow every step through Stream. Name only Stream to Store ready with add_state_transition. |
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.
| Row | Rule |
|---|---|
| Camera sequence | public scenario: Run shows it |
| Board trial B | hidden scenario |
| Board trial C | hidden scenario |
| Intent equals the reference | power states; the domain of every instance; supply ports, nets and their connections; the primary supply of every domain; supply sets and switches |
The Design
The power-unaware RTL your UPF describes (top sensor_hub). Open a file to read it.
sensor_hub.sv
module sensor_hub(input logic grab, output logic request);
assign request = grab;
endmoduleGiven UPF Files
Your file may load these with load_upf. The grader uses the same text.
board.upf
upf_version 4.0
set_design_top sensor_hub
create_power_domain HUB -include_scope
create_supply_port VHOST
create_supply_net VHOST_N
connect_supply_net VHOST_N -ports {VHOST}
create_supply_port VPIX
create_supply_net VPIX_N
connect_supply_net VPIX_N -ports {VPIX}
create_supply_port VBUF
create_supply_net VBUF_N
connect_supply_net VBUF_N -ports {VBUF}
create_supply_port GND
create_supply_net GND_N
connect_supply_net GND_N -ports {GND}
create_supply_set BOARD -function {power VHOST_N} -function {ground GND_N}
associate_supply_set BOARD -handle HUB.primary
create_supply_set PIX -function {power VPIX_N} -function {ground GND_N}
create_supply_set BUF -function {power VBUF_N} -function {ground GND_N}
add_power_state PIX -supply -state {READY -supply_expr {power == {FULL_ON 0.85}}}
add_power_state PIX -supply -update -state {IDLE -supply_expr {power == OFF}}
add_power_state BUF -supply -state {VALID -supply_expr {power == {FULL_ON 0.75}}}
add_power_state BUF -supply -update -state {EMPTY -supply_expr {power == OFF}}
add_power_state HUB -domain -state {Store -logic_expr {PIX == READY && BUF == VALID}}
add_power_state HUB -domain -update -state {Stream -logic_expr {PIX == READY && BUF == EMPTY}}
add_power_state HUB -domain -update -state {Rest -logic_expr {PIX == IDLE && BUF == EMPTY}}
The Public Scenario
Camera sequence. Run checks its output and shows the expected lines and any failure.
tb.sv (public scenario)
`timescale 1ns/1ps
module tb;
import UPF::*;
logic grab=0;
wire request;
sensor_hub dut(.*);
initial begin
void'(supply_on("VHOST",1.0)); void'(supply_on("GND",0.0));
#1;
void'(supply_off("VPIX")); void'(supply_off("VBUF")); grab=0; #2;
$display("sample 1 pixel=%b buffer=%b request=%b pix_state=%0s mode=%0s D8=%0d",get_supply_on_state(get_supply_value("VPIX")),get_supply_on_state(get_supply_value("VBUF")),request,dut.openpa_cn1(openpa_ss_PIX_st),dut.openpa_cn3(openpa_ds_HUB_st),dut.openpa_n[8]);
void'(supply_on("VPIX",0.85)); void'(supply_off("VBUF")); grab=0; #2;
$display("sample 2 pixel=%b buffer=%b request=%b pix_state=%0s mode=%0s D8=%0d",get_supply_on_state(get_supply_value("VPIX")),get_supply_on_state(get_supply_value("VBUF")),request,dut.openpa_cn1(openpa_ss_PIX_st),dut.openpa_cn3(openpa_ds_HUB_st),dut.openpa_n[8]);
void'(supply_on("VPIX",0.85)); void'(supply_on("VBUF",0.75)); grab=0; #2;
$display("sample 3 pixel=%b buffer=%b request=%b pix_state=%0s mode=%0s D8=%0d",get_supply_on_state(get_supply_value("VPIX")),get_supply_on_state(get_supply_value("VBUF")),request,dut.openpa_cn1(openpa_ss_PIX_st),dut.openpa_cn3(openpa_ds_HUB_st),dut.openpa_n[8]);
void'(supply_on("VPIX",0.85)); void'(supply_off("VBUF")); grab=0; #2;
$display("sample 4 pixel=%b buffer=%b request=%b pix_state=%0s mode=%0s D8=%0d",get_supply_on_state(get_supply_value("VPIX")),get_supply_on_state(get_supply_value("VBUF")),request,dut.openpa_cn1(openpa_ss_PIX_st),dut.openpa_cn3(openpa_ds_HUB_st),dut.openpa_n[8]);
void'(supply_off("VPIX")); void'(supply_off("VBUF")); grab=0; #2;
$display("sample 5 pixel=%b buffer=%b request=%b pix_state=%0s mode=%0s D8=%0d",get_supply_on_state(get_supply_value("VPIX")),get_supply_on_state(get_supply_value("VBUF")),request,dut.openpa_cn1(openpa_ss_PIX_st),dut.openpa_cn3(openpa_ds_HUB_st),dut.openpa_n[8]);
$finish;
end
endmoduleExamples
Example 1
Pixel and Buffer Rails (Recorded)- Input
Load board.upf.
- OpenPA reports (recorded)
Supply network VPIX_N: port VPIX {port:VPIX net:VPIX_N fn:PIX.power} VBUF_N: port VBUF {port:VBUF net:VBUF_N fn:BUF.power}
Each regulator drives its own net. Follow each port name to the connected net.
Example 2
The Domain in the Starter (Recorded)- Input
Read the starter with board.upf.
- OpenPA reports (recorded)
Power domains HUB (board.upf:3): sensor_hub primary supply BOARD: power VHOST_N, ground GND_N
HUB contains the camera logic. Its primary supply stays on during the sequence.
Example 3
Camera Sequence (Recorded)- Input
Apply the public regulator and request sequence.
- The bench prints (recorded)
sample 1 pixel=0 buffer=0 request=0 pix_state=IDLE mode=Rest D8=0 sample 2 pixel=1 buffer=0 request=0 pix_state=READY mode=Stream D8=0 sample 3 pixel=1 buffer=1 request=0 pix_state=READY mode=Store D8=0 sample 4 pixel=1 buffer=0 request=0 pix_state=READY mode=Stream D8=0 sample 5 pixel=0 buffer=0 request=0 pix_state=IDLE mode=Rest D8=0
Both directions pass through Stream here. Neither shortcut occurs, so the cumulative D8 count stays at zero.
Constraints and Contract
- Load board.upf. Keep its supply ports, nets and supply-set wiring as given.
- Use -update on later add_power_state commands for the same object. The grader checks settled modes and D8 reports.
Hints
Hint 1
The camera input is grab. The request output follows grab.
Hint 2
Follow a legal path through the sample before considering the other paths.
Hint 3
Check what the policy says at the first differing sample.
What the grader checks: OpenPA checks the digital supply model at the requested voltages.
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