Matt Venn | 08cd6eb | 2020-11-16 12:01:14 +0100 | [diff] [blame^] | 1 | `default_nettype none |
Tim Edwards | 21a9aac | 2020-10-12 22:05:18 -0400 | [diff] [blame] | 2 | `timescale 1 ns / 1 ps |
| 3 | |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 4 | module 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 Edwards | 21a9aac | 2020-10-12 22:05:18 -0400 | [diff] [blame] | 18 | inode <= 1'b0; |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 19 | 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 Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 34 | .VPWR(vdd3v3), |
| 35 | .VGND(vss), |
| 36 | .VPB(vdd3v3), |
| 37 | .VNB(vss), |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 38 | .A(inode), |
| 39 | .X(mid) |
| 40 | ); |
| 41 | |
| 42 | sky130_fd_sc_hvl__schmittbuf hystbuf2 ( |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 43 | .VPWR(vdd3v3), |
| 44 | .VGND(vss), |
| 45 | .VPB(vdd3v3), |
| 46 | .VNB(vss), |
Tim Edwards | f51dd08 | 2020-10-05 16:30:24 -0400 | [diff] [blame] | 47 | .A(mid), |
| 48 | .X(porb_h) |
| 49 | ); |
| 50 | |
| 51 | endmodule |