blob: f308fbf61ab9f97b10cc0c894b458afa03a22d9e [file] [log] [blame]
Tim Edwards21a9aac2020-10-12 22:05:18 -04001`timescale 1 ns / 1 ps
2
Tim Edwardsf51dd082020-10-05 16:30:24 -04003module simple_por(
4 input vdd3v3,
5 input vss,
6 output porb_h
7);
8
9 wire mid, porb_h;
10 reg inode;
11
12 // This is a behavioral model! Actual circuit is a resitor dumping
13 // current (slowly) from vdd3v3 onto a capacitor, and this fed into
14 // two schmitt triggers for strong hysteresis/glitch tolerance.
15
16 initial begin
Tim Edwards21a9aac2020-10-12 22:05:18 -040017 inode <= 1'b0;
Tim Edwardsf51dd082020-10-05 16:30:24 -040018 end
19
20 // Emulate current source on capacitor as a 500ns delay either up or
21 // down.
22
23 always @(posedge vdd3v3) begin
24 #500 inode <= 1'b1;
25 end
26 always @(negedge vdd3v3) begin
27 #500 inode <= 1'b0;
28 end
29
30 // Instantiate two shmitt trigger buffers in series
31
32 sky130_fd_sc_hvl__schmittbuf hystbuf1 (
Tim Edwardsf51dd082020-10-05 16:30:24 -040033 .VPWR(vdd3v3),
34 .VGND(vss),
35 .VPB(vdd3v3),
36 .VNB(vss),
Tim Edwardsf51dd082020-10-05 16:30:24 -040037 .A(inode),
38 .X(mid)
39 );
40
41 sky130_fd_sc_hvl__schmittbuf hystbuf2 (
Tim Edwardsf51dd082020-10-05 16:30:24 -040042 .VPWR(vdd3v3),
43 .VGND(vss),
44 .VPB(vdd3v3),
45 .VNB(vss),
Tim Edwardsf51dd082020-10-05 16:30:24 -040046 .A(mid),
47 .X(porb_h)
48 );
49
50endmodule