blob: 2c51e9a06587ecd9b050de13035b26f4b6d6d6dd [file] [log] [blame]
Matt Venn08cd6eb2020-11-16 12:01:14 +01001`default_nettype none
Tim Edwards21a9aac2020-10-12 22:05:18 -04002`timescale 1 ns / 1 ps
3
Tim Edwardsf51dd082020-10-05 16:30:24 -04004module simple_por(
5 input vdd3v3,
6 input vss,
7 output porb_h
8);
9
10 wire mid, porb_h;
11 reg inode;
12
13 // This is a behavioral model! Actual circuit is a resitor dumping
14 // current (slowly) from vdd3v3 onto a capacitor, and this fed into
15 // two schmitt triggers for strong hysteresis/glitch tolerance.
16
17 initial begin
Tim Edwards21a9aac2020-10-12 22:05:18 -040018 inode <= 1'b0;
Tim Edwardsf51dd082020-10-05 16:30:24 -040019 end
20
21 // Emulate current source on capacitor as a 500ns delay either up or
22 // down.
23
24 always @(posedge vdd3v3) begin
25 #500 inode <= 1'b1;
26 end
27 always @(negedge vdd3v3) begin
28 #500 inode <= 1'b0;
29 end
30
31 // Instantiate two shmitt trigger buffers in series
32
33 sky130_fd_sc_hvl__schmittbuf hystbuf1 (
Tim Edwardsf51dd082020-10-05 16:30:24 -040034 .VPWR(vdd3v3),
35 .VGND(vss),
36 .VPB(vdd3v3),
37 .VNB(vss),
Tim Edwardsf51dd082020-10-05 16:30:24 -040038 .A(inode),
39 .X(mid)
40 );
41
42 sky130_fd_sc_hvl__schmittbuf hystbuf2 (
Tim Edwardsf51dd082020-10-05 16:30:24 -040043 .VPWR(vdd3v3),
44 .VGND(vss),
45 .VPB(vdd3v3),
46 .VNB(vss),
Tim Edwardsf51dd082020-10-05 16:30:24 -040047 .A(mid),
48 .X(porb_h)
49 );
50
51endmodule