OpenCores
URL https://opencores.org/ocsvn/rtftextcontroller/rtftextcontroller/trunk

Subversion Repositories rtftextcontroller

[/] [rtftextcontroller/] [trunk/] [rtl/] [verilog/] [rtfTextController3.v] - Diff between revs 22 and 25

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 22 Rev 25
Line 66... Line 66...
        rst_i, clk_i,
        rst_i, clk_i,
        cyc_i, stb_i, ack_o, we_i, adr_i, dat_i, dat_o,
        cyc_i, stb_i, ack_o, we_i, adr_i, dat_i, dat_o,
        lp, curpos,
        lp, curpos,
        vclk, hsync, vsync, blank, border, rgbIn, rgbOut
        vclk, hsync, vsync, blank, border, rgbIn, rgbOut
);
);
parameter COLS = 12'd56;
parameter num = 4'd1;
 
parameter COLS = 12'd84;
parameter ROWS = 12'd31;
parameter ROWS = 12'd31;
parameter pTextAddress = 32'hFFD00000;
parameter pTextAddress = 32'hFFD00000;
parameter pBitmapAddress = 32'hFFD20000;
parameter pBitmapAddress = 32'hFFD20000;
parameter pRegAddress = 32'hFFDA0000;
parameter pRegAddress = 32'hFFDA0000;
 
 
Line 161... Line 162...
// Address Decoding
// Address Decoding
// I/O range Dx
// I/O range Dx
//--------------------------------------------------------------------
//--------------------------------------------------------------------
wire cs_text = cyc_i && stb_i && (adr_i[31:16]==pTextAddress[31:16]);
wire cs_text = cyc_i && stb_i && (adr_i[31:16]==pTextAddress[31:16]);
wire cs_rom  = cyc_i && stb_i && (adr_i[31:16]==pBitmapAddress[31:16]);
wire cs_rom  = cyc_i && stb_i && (adr_i[31:16]==pBitmapAddress[31:16]);
wire cs_reg  = cyc_i && stb_i && (adr_i[31: 8]==pRegAddress[31:8]);
wire cs_reg  = cyc_i && stb_i && (adr_i[31: 6]==pRegAddress[31:6]);
wire cs_any = cs_text|cs_rom|cs_reg;
wire cs_any = cs_text|cs_rom|cs_reg;
 
 assign tdat_o[9] = 1'b0;
 
 
// Register outputs
// Register outputs
always @(posedge clk_i)
always @(posedge clk_i)
        if (cs_text) dat_o <= {4'd0,tdat_o};
        if (cs_text) dat_o <= {4'd0,tdat_o};
        else if (cs_rom) dat_o <= {23'd0,chdat_o};
        else if (cs_rom) dat_o <= {23'd0,chdat_o};
Line 367... Line 369...
                windowLeft   <= 12'd90;
                windowLeft   <= 12'd90;
                pixelWidth   <= 4'd1;           // 681 pixels
                pixelWidth   <= 4'd1;           // 681 pixels
                pixelHeight  <= 4'd1;           // 384 pixels
                pixelHeight  <= 4'd1;           // 384 pixels
*/
*/
                // 56x31
                // 56x31
                windowTop    <= 12'd16;
                if (num==4'd1) begin
                windowLeft   <= 12'd56;
            windowTop    <= 12'd16;//12'd16;
                pixelWidth   <= 4'd2;           // 455 pixels
            windowLeft   <= 12'h66;//12'd86;
 
            pixelWidth   <= 4'd1;               // 680 pixels
                pixelHeight  <= 4'd2;           // 256 pixels
                pixelHeight  <= 4'd2;           // 256 pixels
                numCols      <= COLS;
                numCols      <= COLS;
                numRows      <= ROWS;
                numRows      <= ROWS;
                maxScanline  <= 5'd7;
                maxScanline  <= 5'd7;
                maxScanpix   <= 5'd7;
                maxScanpix   <= 5'd7;
Line 384... Line 387...
                cursorPos    <= 16'h0003;
                cursorPos    <= 16'h0003;
                cursorType       <= 2'b00;
                cursorType       <= 2'b00;
                txtTcCode    <= 9'h1ff;
                txtTcCode    <= 9'h1ff;
                charOutDelay <= 12'd2;
                charOutDelay <= 12'd2;
        end
        end
 
                else if (num==4'd2) begin
 
            windowTop    <= 12'd64;//12'd16;
 
            windowLeft   <= 12'h376;//12'd86;
 
            pixelWidth   <= 4'd0;        // 680 pixels
 
            pixelHeight  <= 4'd1;        // 256 pixels
 
            numCols      <= 40;
 
            numRows      <= 25;
 
            maxScanline  <= 5'd7;
 
            maxScanpix   <= 5'd7;
 
            rBlink       <= 3'b111;        // 01 = non display
 
            startAddress <= 16'h0000;
 
            cursorStart  <= 5'd00;
 
            cursorEnd    <= 5'd31;
 
            cursorPos    <= 16'h0003;
 
            cursorType   <= 2'b00;
 
            txtTcCode    <= 9'h1ff;
 
            charOutDelay <= 12'd2;
 
                end
 
        end
        else begin
        else begin
 
 
                if (cs_reg & we_i) begin        // register write ?
                if (cs_reg & we_i) begin        // register write ?
 
                        $display("TC Write: r%d=%h", adr_i[5:2], dat_i);
                        case(adr_i[5:2])
                        case(adr_i[5:2])
                        4'd00:  begin
                        4'd00:  begin
                                        numCols    <= dat_i[15:0];               // horizontal displayed
                                        numCols    <= dat_i[15:0];               // horizontal displayed
                                        charOutDelay <= dat_i[31:16];
                                        charOutDelay <= dat_i[31:16];
                                        end
                                        end
Line 401... Line 423...
                        4'd04:  maxScanline <= dat_i[4:0];
                        4'd04:  maxScanline <= dat_i[4:0];
                        4'd05:  begin
                        4'd05:  begin
                                        pixelHeight <= dat_i[7:4];
                                        pixelHeight <= dat_i[7:4];
                                        pixelWidth  <= dat_i[3:0];       // horizontal pixel width
                                        pixelWidth  <= dat_i[3:0];       // horizontal pixel width
                                        end
                                        end
                        4'd07:  txtTcCode   <= dat_i[4:0];
                        4'd07:  txtTcCode   <= dat_i[8:0];
                        4'd08:  begin
                        4'd08:  begin
                                        cursorStart <= dat_i[4:0];       // scan line sursor starts on
                                        cursorStart <= dat_i[4:0];       // scan line sursor starts on
                                        rBlink      <= dat_i[7:5];
                                        rBlink      <= dat_i[7:5];
                                        cursorType  <= dat_i[9:8];
                                        cursorType  <= dat_i[9:8];
                                        end
                                        end
                        4'd09:  cursorEnd   <= dat_i[4:0];       // scan line cursor ends on
                        4'd09:  cursorEnd   <= dat_i[4:0];       // scan line cursor ends on
                        4'd10:  startAddress <= dat_i;
                        4'd10:  startAddress <= dat_i;
                        4'd11:  cursorPos <= dat_i;
                        4'd11:  cursorPos <= dat_i[15:0];
 
                        default: ;
                        endcase
                        endcase
                end
                end
        end
        end
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.