diff options
| author | github-classroom[bot] <66690702+github-classroom[bot]@users.noreply.github.com> | 2026-02-05 19:36:36 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-05 19:36:36 +0000 |
| commit | ead28dd6fed440ccf4667c459778012bb0d95733 (patch) | |
| tree | bbc326fa1b487efc0fe163ef733a76c8a241fbb0 /vga-hacks/vga_adapter_window.sv | |
Initial commit
Diffstat (limited to 'vga-hacks/vga_adapter_window.sv')
| -rw-r--r-- | vga-hacks/vga_adapter_window.sv | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/vga-hacks/vga_adapter_window.sv b/vga-hacks/vga_adapter_window.sv new file mode 100644 index 0000000..278903c --- /dev/null +++ b/vga-hacks/vga_adapter_window.sv @@ -0,0 +1,24 @@ +// For simulation only + +module vga_adapter(input logic resetn, input logic clock, input logic [2:0] colour, + input logic [7:0] x, input logic [6:0] y, input logic plot, + output logic [9:0] VGA_R, output logic [9:0] VGA_G, output logic [9:0] VGA_B, + output logic VGA_HS, output logic VGA_VS, output logic VGA_BLANK, + output logic VGA_SYNC, output logic VGA_CLK); + parameter BITS_PER_COLOUR_CHANNEL = 1; + parameter MONOCHROME = "FALSE"; + parameter RESOLUTION = "320x240"; + parameter BACKGROUND_IMAGE = "background.mif"; + parameter USING_DE1 = "FALSE"; + + always_ff @(posedge clock, negedge resetn) begin + if (!resetn) begin + void'(mti_fli::mti_Cmd("vga::reset")); + end else if (plot) begin + if ((^x === 1'bx) || (^y === 1'bx) || (^colour === 1'bx)) + $error("cannot plot undefined values"); + else + void'(mti_fli::mti_Cmd($sformatf("vga::plot %d %d %d", x, y, colour))); + end + end +endmodule: vga_adapter |