Renderer testcase runs

This commit is contained in:
jaseg 2021-06-17 19:16:34 +02:00
parent a7953cfb89
commit 579f5a7f92
9 changed files with 1847 additions and 809 deletions

View file

@ -42,7 +42,7 @@
<Option Name="IPUserFilesDir" Val="$PIPUSERFILESDIR"/>
<Option Name="IPStaticSourceDir" Val="$PIPUSERFILESDIR/ipstatic"/>
<Option Name="EnableBDX" Val="FALSE"/>
<Option Name="WTXSimLaunchSim" Val="220"/>
<Option Name="WTXSimLaunchSim" Val="269"/>
<Option Name="WTModelSimLaunchSim" Val="0"/>
<Option Name="WTQuestaLaunchSim" Val="0"/>
<Option Name="WTIesLaunchSim" Val="0"/>
@ -214,6 +214,21 @@
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/src/term_renderer.v">
<FileInfo>
<Attr Name="AutoDisabled" Val="1"/>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/src/gen/gen_font_params_default.vh">
<FileInfo>
<Attr Name="AutoDisabled" Val="1"/>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopModule" Val="hdmi_design"/>
@ -235,8 +250,16 @@
</FileSet>
<FileSet Name="sim_1" Type="SimulationSrcs" RelSrcDir="$PSRCDIR/sim_1">
<Filter Type="Srcs"/>
<File Path="$PPRDIR/test_bench/term_renderer_tb.v">
<FileInfo>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/test_bench/window_matcher_tb.v">
<FileInfo>
<Attr Name="AutoDisabled" Val="1"/>
<Attr Name="UsedIn" Val="synthesis"/>
<Attr Name="UsedIn" Val="implementation"/>
<Attr Name="UsedIn" Val="simulation"/>
@ -303,9 +326,14 @@
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<File Path="$PPRDIR/term_renderer_tb_behav.wcfg">
<FileInfo>
<Attr Name="UsedIn" Val="simulation"/>
</FileInfo>
</File>
<Config>
<Option Name="DesignMode" Val="RTL"/>
<Option Name="TopModule" Val="window_matcher_tb"/>
<Option Name="TopModule" Val="term_renderer_tb"/>
<Option Name="TopLib" Val="xil_defaultlib"/>
<Option Name="TransportPathDelay" Val="0"/>
<Option Name="TransportIntDelay" Val="0"/>
@ -317,6 +345,7 @@
<Option Name="SrcSet" Val="sources_1"/>
<Option Name="XSimWcfgFile" Val="$PPRDIR/tb_hdmi_decode_behav.wcfg"/>
<Option Name="XSimWcfgFile" Val="$PPRDIR/window_matcher_tb_behav.wcfg"/>
<Option Name="XSimWcfgFile" Val="$PPRDIR/term_renderer_tb_behav.wcfg"/>
<Option Name="xsim.simulate.runtime" Val="10ms"/>
<Option Name="NLNetlistMode" Val="funcsim"/>
</Config>

File diff suppressed because one or more lines are too long

View file

@ -2,6 +2,54 @@
module gen_charmap_is_printable_default(input glyph[15:0], output reg is_printable) begin
always @(glyph) begin
case(glyph)
16'h0000: is_printable <= 1;
16'h0001: is_printable <= 1;
16'h0002: is_printable <= 1;
16'h0003: is_printable <= 1;
16'h0004: is_printable <= 1;
16'h0005: is_printable <= 1;
16'h0006: is_printable <= 1;
16'h0007: is_printable <= 1;
16'h0008: is_printable <= 1;
16'h0009: is_printable <= 1;
16'h000a: is_printable <= 1;
16'h000b: is_printable <= 1;
16'h000c: is_printable <= 1;
16'h000d: is_printable <= 1;
16'h000e: is_printable <= 1;
16'h000f: is_printable <= 1;
16'h0010: is_printable <= 1;
16'h0011: is_printable <= 1;
16'h0012: is_printable <= 1;
16'h0013: is_printable <= 1;
16'h0014: is_printable <= 1;
16'h0015: is_printable <= 1;
16'h0016: is_printable <= 1;
16'h0017: is_printable <= 1;
16'h0018: is_printable <= 1;
16'h0019: is_printable <= 1;
16'h001a: is_printable <= 1;
16'h001b: is_printable <= 1;
16'h001c: is_printable <= 1;
16'h001d: is_printable <= 1;
16'h001e: is_printable <= 1;
16'h001f: is_printable <= 1;
16'h0020: is_printable <= 1;
16'h0021: is_printable <= 1;
16'h0022: is_printable <= 1;
16'h0023: is_printable <= 1;
16'h0024: is_printable <= 1;
16'h0025: is_printable <= 1;
16'h0026: is_printable <= 1;
16'h0027: is_printable <= 1;
16'h0028: is_printable <= 1;
16'h0029: is_printable <= 1;
16'h002a: is_printable <= 1;
16'h002b: is_printable <= 1;
16'h002c: is_printable <= 1;
16'h002d: is_printable <= 1;
16'h002e: is_printable <= 1;
16'h002f: is_printable <= 1;
16'h0030: is_printable <= 1;
16'h0031: is_printable <= 1;
16'h0032: is_printable <= 1;
@ -12,32 +60,13 @@ module gen_charmap_is_printable_default(input glyph[15:0], output reg is_printab
16'h0037: is_printable <= 1;
16'h0038: is_printable <= 1;
16'h0039: is_printable <= 1;
16'h0061: is_printable <= 1;
16'h0062: is_printable <= 1;
16'h0063: is_printable <= 1;
16'h0064: is_printable <= 1;
16'h0065: is_printable <= 1;
16'h0066: is_printable <= 1;
16'h0067: is_printable <= 1;
16'h0068: is_printable <= 1;
16'h0069: is_printable <= 1;
16'h006a: is_printable <= 1;
16'h006b: is_printable <= 1;
16'h006c: is_printable <= 1;
16'h006d: is_printable <= 1;
16'h006e: is_printable <= 1;
16'h006f: is_printable <= 1;
16'h0070: is_printable <= 1;
16'h0071: is_printable <= 1;
16'h0072: is_printable <= 1;
16'h0073: is_printable <= 1;
16'h0074: is_printable <= 1;
16'h0075: is_printable <= 1;
16'h0076: is_printable <= 1;
16'h0077: is_printable <= 1;
16'h0078: is_printable <= 1;
16'h0079: is_printable <= 1;
16'h007a: is_printable <= 1;
16'h003a: is_printable <= 1;
16'h003b: is_printable <= 1;
16'h003c: is_printable <= 1;
16'h003d: is_printable <= 1;
16'h003e: is_printable <= 1;
16'h003f: is_printable <= 1;
16'h0040: is_printable <= 1;
16'h0041: is_printable <= 1;
16'h0042: is_printable <= 1;
16'h0043: is_printable <= 1;
@ -64,39 +93,43 @@ module gen_charmap_is_printable_default(input glyph[15:0], output reg is_printab
16'h0058: is_printable <= 1;
16'h0059: is_printable <= 1;
16'h005a: is_printable <= 1;
16'h0021: is_printable <= 1;
16'h0022: is_printable <= 1;
16'h0023: is_printable <= 1;
16'h0024: is_printable <= 1;
16'h0025: is_printable <= 1;
16'h0026: is_printable <= 1;
16'h0027: is_printable <= 1;
16'h0028: is_printable <= 1;
16'h0029: is_printable <= 1;
16'h002a: is_printable <= 1;
16'h002b: is_printable <= 1;
16'h002c: is_printable <= 1;
16'h002d: is_printable <= 1;
16'h002e: is_printable <= 1;
16'h002f: is_printable <= 1;
16'h003a: is_printable <= 1;
16'h003b: is_printable <= 1;
16'h003c: is_printable <= 1;
16'h003d: is_printable <= 1;
16'h003e: is_printable <= 1;
16'h003f: is_printable <= 1;
16'h0040: is_printable <= 1;
16'h005b: is_printable <= 1;
16'h005c: is_printable <= 1;
16'h005d: is_printable <= 1;
16'h005e: is_printable <= 1;
16'h005f: is_printable <= 1;
16'h0060: is_printable <= 1;
16'h0061: is_printable <= 1;
16'h0062: is_printable <= 1;
16'h0063: is_printable <= 1;
16'h0064: is_printable <= 1;
16'h0065: is_printable <= 1;
16'h0066: is_printable <= 1;
16'h0067: is_printable <= 1;
16'h0068: is_printable <= 1;
16'h0069: is_printable <= 1;
16'h006a: is_printable <= 1;
16'h006b: is_printable <= 1;
16'h006c: is_printable <= 1;
16'h006d: is_printable <= 1;
16'h006e: is_printable <= 1;
16'h006f: is_printable <= 1;
16'h0070: is_printable <= 1;
16'h0071: is_printable <= 1;
16'h0072: is_printable <= 1;
16'h0073: is_printable <= 1;
16'h0074: is_printable <= 1;
16'h0075: is_printable <= 1;
16'h0076: is_printable <= 1;
16'h0077: is_printable <= 1;
16'h0078: is_printable <= 1;
16'h0079: is_printable <= 1;
16'h007a: is_printable <= 1;
16'h007b: is_printable <= 1;
16'h007c: is_printable <= 1;
16'h007d: is_printable <= 1;
16'h007e: is_printable <= 1;
16'h0020: is_printable <= 1;
16'h007f: is_printable <= 1;
default: is_printable <= 0;
endcase
end

View file

@ -1,3 +1,3 @@
`define GEN_FONT_GLYPH_W_default 8
`define GEN_FONT_GLYPH_H_default 16
`define GEN_FONT_GLYPH_COUNT_default 95
`define GEN_FONT_GLYPH_COUNT_default 128

File diff suppressed because it is too large Load diff

View file

@ -8,21 +8,22 @@ input in_vsync, in_hsync,
input [15:0] glyphmem_data,
output [15:0] glyphmem_r_addr,
output out_hsync, out_vsync,
output [7:0] out_red,
output [7:0] out_green,
output [7:0] out_blue
);
parameter GLYPHMEM_W = 512; /* glyphs */
parameter GLYPHMEM_H = 256; /* glyphs */
parameter GLYPHMEM_W = 256; /* glyphs */
parameter GLYPHMEM_H = 128; /* glyphs */
/* Glyph table instantiation */
`include "gen/gen_font_params_default.vh"
`define FONT_GLYPH_W GEN_FONT_GLYPH_W_default
`define FONT_GLYPH_H GEN_FONT_GLYPH_H_default
`define FONT_GLYPH_COUNT GEN_FONT_GLYPH_COUNT_default
reg [FONT_GLYPH_W-1:0] glyph_table [0:FONT_GLYPH_COUNT-1];
initial $readmemh("../../../../src/gen/gen_glyphtable_default.hex", glyph_table_deault);
localparam FONT_GLYPH_W = `GEN_FONT_GLYPH_W_default;
localparam FONT_GLYPH_H = `GEN_FONT_GLYPH_H_default;
localparam FONT_GLYPH_COUNT = `GEN_FONT_GLYPH_COUNT_default;
reg [FONT_GLYPH_W-1:0] glyph_table_default [0:FONT_GLYPH_COUNT*FONT_GLYPH_H-1];
initial $readmemh("../../../../src/gen/gen_glyphtable_default.hex", glyph_table_default);
/* Glyph x/y synchronization logic */
reg [11:0] glyph_x;
@ -32,7 +33,14 @@ reg [5:0] px_x;
reg [5:0] px_y;
reg in_hsync_last, in_vsync_last;
assign out_vsync = in_vsync_last;
assign out_hsync = in_hsync_last;
assign glyphmem_r_addr = (GLYPHMEM_W*glyph_y) + glyph_x;
assign out_red = {8{glyph_sreg_out[FONT_GLYPH_W-1]}};
assign out_green = {8{glyph_sreg_out[FONT_GLYPH_W-1]}};
assign out_blue = {8{glyph_sreg_out[FONT_GLYPH_W-1]}};
/* TODO: fg/bg color, bold, italic, underline, blink */
always @(posedge clk) begin
if (rst) begin
@ -42,6 +50,7 @@ always @(posedge clk) begin
px_y <= 0;
in_hsync_last <= 0;
in_vsync_last <= 0;
glyph_sreg_out <= 0;
end else begin
in_hsync_last <= in_hsync;
@ -55,18 +64,27 @@ always @(posedge clk) begin
px_y <= px_y + 1;
end else begin
glyph_y <= glyph_y + 1;
px_y <= 0;
end
end else if (in_hsync) begin
if (px_x != FONT_GLYPH_W-1) begin
px_x <= px_x + 1;
glyph_sreg_out <= {glyph_sreg_out[FONT_GLYPH_W-2:0], 0};
end else begin
px_x <= 0;
glyph_sreg_out <= glyph_table[glyphmem_data[7:0]];
glyph_x <= glyph_x + 1;
end
if (px_x == 0) begin
glyph_sreg_out <= glyph_table_default[glyphmem_data[7:0]*FONT_GLYPH_H + px_y];
glyph_x <= glyph_x + 1;
end else begin
glyph_sreg_out <= {glyph_sreg_out[FONT_GLYPH_W-2:0], 1'b0};
end
end else if (!in_hsync_last) begin
glyph_sreg_out <= 0;
end
if (in_vsync_last && !in_vsync) begin

126
term_renderer_tb_behav.wcfg Normal file
View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<wave_config>
<wave_state>
</wave_state>
<db_ref_list>
<db_ref path="term_renderer_tb_behav.wdb" id="1">
<top_modules>
<top_module name="glbl" />
<top_module name="term_renderer_tb" />
</top_modules>
</db_ref>
</db_ref_list>
<zoom_setting>
<ZoomStartTime time="2811200fs"></ZoomStartTime>
<ZoomEndTime time="3072701fs"></ZoomEndTime>
<Cursor1Time time="2905300fs"></Cursor1Time>
</zoom_setting>
<column_width_setting>
<NameColumnWidth column_width="175"></NameColumnWidth>
<ValueColumnWidth column_width="158"></ValueColumnWidth>
</column_width_setting>
<WVObjectSize size="22" />
<wvobject fp_name="/term_renderer_tb/testcase_id" type="array">
<obj_property name="ElementShortName">testcase_id[31:0]</obj_property>
<obj_property name="ObjectShortName">testcase_id[31:0]</obj_property>
<obj_property name="CustomSignalColor">#008000</obj_property>
<obj_property name="UseCustomSignalColor">true</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/rst" type="logic">
<obj_property name="ElementShortName">rst</obj_property>
<obj_property name="ObjectShortName">rst</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/clk" type="logic">
<obj_property name="ElementShortName">clk</obj_property>
<obj_property name="ObjectShortName">clk</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/in_vsync" type="logic">
<obj_property name="ElementShortName">in_vsync</obj_property>
<obj_property name="ObjectShortName">in_vsync</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/in_hsync" type="logic">
<obj_property name="ElementShortName">in_hsync</obj_property>
<obj_property name="ObjectShortName">in_hsync</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/glyphmem_data" type="array">
<obj_property name="ElementShortName">glyphmem_data[15:0]</obj_property>
<obj_property name="ObjectShortName">glyphmem_data[15:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/glyphmem_r_addr" type="array">
<obj_property name="ElementShortName">glyphmem_r_addr[15:0]</obj_property>
<obj_property name="ObjectShortName">glyphmem_r_addr[15:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/out_red" type="array">
<obj_property name="ElementShortName">out_red[7:0]</obj_property>
<obj_property name="ObjectShortName">out_red[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/out_green" type="array">
<obj_property name="ElementShortName">out_green[7:0]</obj_property>
<obj_property name="ObjectShortName">out_green[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/out_blue" type="array">
<obj_property name="ElementShortName">out_blue[7:0]</obj_property>
<obj_property name="ObjectShortName">out_blue[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/glyph_sreg_out" type="array">
<obj_property name="ElementShortName">glyph_sreg_out[7:0]</obj_property>
<obj_property name="ObjectShortName">glyph_sreg_out[7:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/glyph_x" type="array">
<obj_property name="ElementShortName">glyph_x[11:0]</obj_property>
<obj_property name="ObjectShortName">glyph_x[11:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
<obj_property name="CustomSignalColor">#FFFF00</obj_property>
<obj_property name="UseCustomSignalColor">true</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/glyph_y" type="array">
<obj_property name="ElementShortName">glyph_y[11:0]</obj_property>
<obj_property name="ObjectShortName">glyph_y[11:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
<obj_property name="CustomSignalColor">#FFFF00</obj_property>
<obj_property name="UseCustomSignalColor">true</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/px_x" type="array">
<obj_property name="ElementShortName">px_x[5:0]</obj_property>
<obj_property name="ObjectShortName">px_x[5:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
<obj_property name="CustomSignalColor">#FFFF00</obj_property>
<obj_property name="UseCustomSignalColor">true</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/px_y" type="array">
<obj_property name="ElementShortName">px_y[5:0]</obj_property>
<obj_property name="ObjectShortName">px_y[5:0]</obj_property>
<obj_property name="Radix">UNSIGNEDDECRADIX</obj_property>
<obj_property name="CustomSignalColor">#FFFF00</obj_property>
<obj_property name="UseCustomSignalColor">true</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/in_hsync_last" type="logic">
<obj_property name="ElementShortName">in_hsync_last</obj_property>
<obj_property name="ObjectShortName">in_hsync_last</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/in_vsync_last" type="logic">
<obj_property name="ElementShortName">in_vsync_last</obj_property>
<obj_property name="ObjectShortName">in_vsync_last</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/GLYPHMEM_W" type="array">
<obj_property name="ElementShortName">GLYPHMEM_W[31:0]</obj_property>
<obj_property name="ObjectShortName">GLYPHMEM_W[31:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/GLYPHMEM_H" type="array">
<obj_property name="ElementShortName">GLYPHMEM_H[31:0]</obj_property>
<obj_property name="ObjectShortName">GLYPHMEM_H[31:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/FONT_GLYPH_W" type="array">
<obj_property name="ElementShortName">FONT_GLYPH_W[31:0]</obj_property>
<obj_property name="ObjectShortName">FONT_GLYPH_W[31:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/FONT_GLYPH_H" type="array">
<obj_property name="ElementShortName">FONT_GLYPH_H[31:0]</obj_property>
<obj_property name="ObjectShortName">FONT_GLYPH_H[31:0]</obj_property>
</wvobject>
<wvobject fp_name="/term_renderer_tb/term_renderer_dut/FONT_GLYPH_COUNT" type="array">
<obj_property name="ElementShortName">FONT_GLYPH_COUNT[31:0]</obj_property>
<obj_property name="ObjectShortName">FONT_GLYPH_COUNT[31:0]</obj_property>
</wvobject>
</wave_config>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,107 @@
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 06/15/2021 10:49:32 AM
// Design Name:
// Module Name: window_matcher_tb
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module term_renderer_tb();
parameter GLYPHMEM_W = 256; /* glyphs */
parameter GLYPHMEM_H = 128; /* glyphs */
localparam period = 4;
localparam REC_MAXLEN = 1000000;
reg rst, clk;
reg vsync, hsync;
reg [15:0] glyphmem_data;
wire [15:0] glyphmem_r_addr;
wire [7:0] out_red;
wire [7:0] out_green;
wire [7:0] out_blue;
initial begin
rst = 1;
clk = 0;
repeat(2) #period clk = ~clk;
rst = 0;
forever #period clk = ~clk;
end
reg [23:0] data_recording [0:100000];
integer testcase_id;
integer rec_pos;
initial begin
`include "test_data/00TERM_RENDERER_TC_IDX.v"
$finish();
end
always @(posedge clk) begin
if (rst) begin
rec_pos <= 0;
for (integer i=0; i<REC_MAXLEN; i=i+1) begin
data_recording[i] <= 0;
end
end else begin
if (rec_pos != REC_MAXLEN-1) begin
data_recording[rec_pos] = {out_red, out_green, out_blue};
rec_pos = rec_pos + 1;
end else begin
$finish();
end
end
end
reg [15:0] glyphmem [0:GLYPHMEM_W*GLYPHMEM_H-1];
initial $readmemh("../../../../test_bench/test_data/test_glyphmem_data.hex", glyphmem);
always @(posedge clk) begin
if (rst) begin
glyphmem_data <= 0;
end else begin
if (glyphmem_r_addr < GLYPHMEM_W*GLYPHMEM_H) begin
glyphmem_data <= glyphmem[glyphmem_r_addr];
end else begin
glyphmem_data <= 0;
end
end
end
term_renderer #(
.GLYPHMEM_W(GLYPHMEM_W),
.GLYPHMEM_H(GLYPHMEM_H)
) term_renderer_dut (
.rst(rst),
.clk(clk),
.in_vsync(vsync),
.in_hsync(hsync),
.glyphmem_data(glyphmem_data),
.glyphmem_r_addr(glyphmem_r_addr),
.out_red(out_red),
.out_green(out_green),
.out_blue(out_blue)
);
endmodule