////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
// Filename: wbuinput.v
|
// Filename: wbuinput.v
|
//
|
//
|
// Project: XuLA2 board
|
// Project: FPGA library
|
//
|
//
|
// Purpose: Coordinates the receiption of bytes, which are then translated
|
// Purpose: Coordinates the receiption of bytes, which are then translated
|
// into codewords describing postential bus transactions. This
|
// into codewords describing postential bus transactions. This
|
// includes turning the human readable bytes into more compact bits,
|
// includes turning the human readable bytes into more compact bits,
|
// forming those bits into codewords, and decompressing any that reference
|
// forming those bits into codewords, and decompressing any that reference
|
// addresses within a compression table.
|
// addresses within a compression table.
|
//
|
//
|
//
|
//
|
// Creator: Dan Gisselquist, Ph.D.
|
// Creator: Dan Gisselquist, Ph.D.
|
// Gisselquist Technology, LLC
|
// Gisselquist Technology, LLC
|
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
// Copyright (C) 2015, Gisselquist Technology, LLC
|
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
|
//
|
//
|
// This program is free software (firmware): you can redistribute it and/or
|
// This program is free software (firmware): you can redistribute it and/or
|
// modify it under the terms of the GNU General Public License as published
|
// modify it under the terms of the GNU General Public License as published
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
// your option) any later version.
|
// your option) any later version.
|
//
|
//
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
// for more details.
|
// for more details.
|
//
|
//
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
// http://www.gnu.org/licenses/gpl.html
|
// http://www.gnu.org/licenses/gpl.html
|
//
|
//
|
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
//
|
//
|
module wbuinput(i_clk, i_stb, i_byte, o_stb, o_codword);
|
module wbuinput(i_clk, i_stb, i_byte, o_stb, o_codword);
|
input i_clk, i_stb;
|
input i_clk, i_stb;
|
input [7:0] i_byte;
|
input [7:0] i_byte;
|
output wire o_stb;
|
output wire o_stb;
|
output wire [35:0] o_codword;
|
output wire [35:0] o_codword;
|
|
|
wire hx_stb, hx_valid;
|
wire hx_stb, hx_valid;
|
wire [5:0] hx_hexbits;
|
wire [5:0] hx_hexbits;
|
wbutohex tobits(i_clk, i_stb, i_byte,
|
wbutohex tobits(i_clk, i_stb, i_byte,
|
hx_stb, hx_valid, hx_hexbits);
|
hx_stb, hx_valid, hx_hexbits);
|
|
|
wire cw_stb;
|
wire cw_stb;
|
wire [35:0] cw_word;
|
wire [35:0] cw_word;
|
wbureadcw formcw(i_clk, hx_stb, hx_valid, hx_hexbits,
|
wbureadcw formcw(i_clk, hx_stb, hx_valid, hx_hexbits,
|
cw_stb, cw_word);
|
cw_stb, cw_word);
|
|
|
// `define DEBUGGING
|
// `define DEBUGGING
|
`ifdef DEBUGGING
|
`ifdef DEBUGGING
|
assign o_stb = cw_stb;
|
assign o_stb = cw_stb;
|
assign o_codword = cw_word;
|
assign o_codword = cw_word;
|
`else
|
`else
|
wbudecompress unpack(i_clk,cw_stb,cw_word, o_stb, o_codword);
|
wbudecompress unpack(i_clk,cw_stb,cw_word, o_stb, o_codword);
|
`endif
|
`endif
|
|
|
endmodule
|
endmodule
|
|
|