Skip to content

Commit 6583888

Browse files
committed
Spring cleaning of working copy
1 parent 88163a8 commit 6583888

7 files changed

+18
-6
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ make prog
3333
# Verilator (currently not working with SDRAM model)
3434
make sim
3535
36+
# Verilator with options
37+
BOOTROM=firmware/build/test_framebuffer.bin DUMP_FRAMEBUF=framebuffer.ppm NUM_CYCLES=4000000 make sim
38+
3639
# cocotb
3740
make -f Makefile.coco
3841
```

doc/sdram-bandwidth.md

+4
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@
1010
| 100 MHz | 640x480 /8 | 9.2 % |
1111

1212
Justifies having separate code RAM to do something in the meantime?
13+
14+
15+
TODO: profile access latency
16+
TODO: render waveforms

rtl/VGA_Timing_Generator.sv

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ localparam V_BACK_PORCH = 31;
3939
localparam V_TOTAL = V_VISIBLE + V_FRONT_PORCH + 2 + V_BACK_PORCH;
4040

4141
// Clock divider; probably should be externalized
42-
logic[$clog2(CLK_DIV)-1:0] prescaler;
43-
logic clk_en; // pipelined to minimize extra cost
42+
logic[$clog2(CLK_DIV)-1:0] prescaler = 0;
43+
logic clk_en = 0; // pipelined to minimize extra cost
4444

4545
// Line/pixel counting
4646

rtl/Video_Ctrl.sv

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ always @ (posedge clk_i) begin
123123
end
124124
end else if (sdram_rd && sdram_rdy && waitstate == 0) begin
125125
`ifdef VERBOSE
126-
$display("VIDEO_CTRL: got data word [%03d] => %04Xh", line_write_ptr, sdram_rdata);
126+
$display("VIDEO_CTRL: got data word [%03d:%03d] => %04Xh", line_no, line_write_ptr, sdram_rdata);
127127
`endif
128128
if (line_write_ptr[BURST_BITS-1:0] == BURST_LEN - 1) begin
129129
`ifdef VERBOSE

rtl/top.sv

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module top
3131
parameter CLK_SYS_HZ = 50_000_000;
3232

3333
`ifndef SYNTHESIS
34-
wire pixel_valid /* verilator public */ = timing1.blank_n == 1 && timing1.valid;
34+
wire pixel_valid /* verilator public */ = (timing1.blank_n == 1) && timing1.valid;
3535
`endif
3636

3737
assign sdram_cke = 1'b1;

sim/sim_main.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ int main(int argc, char** argv, char** env) {
5454
// top.rootp->cpu.resetn = 0;
5555

5656
VerilatedVcdC trace;
57-
top.trace(&trace, 99);
5857

59-
// trace.open("sim.vcd");
58+
top.trace(&trace, 99);
6059

6160
// execute $initial commands -- must be done before loading ROM or forcing any registers
6261
top.eval();
@@ -112,6 +111,12 @@ int main(int argc, char** argv, char** env) {
112111
framebuffer[pixel_i] = top.top->color2;
113112
pixel_i++;
114113
}
114+
115+
// if (half_cycle == 1000000) {
116+
// ;
117+
118+
// trace.open("sim.vcd");
119+
// }
115120
}
116121

117122
fprintf(stderr, "Simulated %ld cycles\n", half_cycle / 2);

traces/video_burst_2022-05-26.png

74.2 KB
Loading

0 commit comments

Comments
 (0)