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