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

Subversion Repositories wb4pb

[/] [wb4pb/] [trunk/] [impl/] [avnet_sp3a_eval_uart_vlog.v] - Diff between revs 28 and 31

Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 31
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// This sourcecode is released under BSD license.
// This sourcecode is released under BSD license.
// Please see http://www.opensource.org/licenses/bsd-license.php for details!
// Please see http://www.opensource.org/licenses/bsd-license.php for details!
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (c) 2011, Stefan Fischer <Ste.Fis@OpenCores.org>
// Copyright (c) 2011, Stefan Fischer <Ste.Fis@OpenCores.org>
// All rights reserved.
// All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without 
// Redistribution and use in source and binary forms, with or without 
// modification, are permitted provided that the following conditions are met:
// modification, are permitted provided that the following conditions are met:
//
//
//  * Redistributions of source code must retain the above copyright notice, 
//  * Redistributions of source code must retain the above copyright notice, 
//    this list of conditions and the following disclaimer.
//    this list of conditions and the following disclaimer.
//  * Redistributions in binary form must reproduce the above copyright notice,
//  * Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution. 
//    and/or other materials provided with the distribution. 
//  * Neither the name of the author nor the names of his contributors may be 
 
//    used to endorse or promote products derived from this software without 
 
//    specific prior written permission.
 
//
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
// POSSIBILITY OF SUCH DAMAGE.
// POSSIBILITY OF SUCH DAMAGE.
//
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// filename: avnet_sp3a_eval_uart_vlog.v
// filename: avnet_sp3a_eval_uart_vlog.v
// description: synthesizable PicoBlaze (TM) uart example using wishbone /
// description: synthesizable PicoBlaze (TM) uart example using wishbone /
//              AVNET (R) Sp3A-Eval-Kit version
//              AVNET (R) Sp3A-Eval-Kit version
// todo4user: add other modules as needed
// todo4user: add other modules as needed
// version: 0.0.0
// version: 0.0.0
// changelog: - 0.0.0, initial release
// changelog: - 0.0.0, initial release
//            - ...
//            - ...
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
 
 
 
 
module avnet_sp3a_eval_uart_vlog (
module avnet_sp3a_eval_uart_vlog (
  FPGA_RESET,
  FPGA_RESET,
  CLK_16MHZ,
  CLK_16MHZ,
 
 
  UART_TXD,
  UART_TXD,
  UART_RXD,
  UART_RXD,
 
 
  LED1
  LED1
);
);
 
 
  input FPGA_RESET;
  input FPGA_RESET;
  wire  FPGA_RESET;
  wire  FPGA_RESET;
  input CLK_16MHZ;
  input CLK_16MHZ;
  wire  CLK_16MHZ;
  wire  CLK_16MHZ;
 
 
  input UART_TXD;
  input UART_TXD;
  wire  UART_TXD;
  wire  UART_TXD;
  output UART_RXD;
  output UART_RXD;
  wire   UART_RXD;
  wire   UART_RXD;
 
 
  output LED1;
  output LED1;
  wire   LED1;
  wire   LED1;
 
 
  reg rst;
  reg rst;
  wire clk;
  wire clk;
 
 
  wire wb_cyc;
  wire wb_cyc;
  wire wb_stb;
  wire wb_stb;
  wire wb_we;
  wire wb_we;
  wire[7:0] wb_adr;
  wire[7:0] wb_adr;
  wire[7:0] wb_dat_m2s;
  wire[7:0] wb_dat_m2s;
  wire[7:0] wb_dat_s2m;
  wire[7:0] wb_dat_s2m;
  wire wb_ack;
  wire wb_ack;
 
 
  wire pb_write_strobe;
  wire pb_write_strobe;
  wire pb_read_strobe;
  wire pb_read_strobe;
  wire[7:0] pb_port_id;
  wire[7:0] pb_port_id;
  wire[7:0] pb_in_port;
  wire[7:0] pb_in_port;
  wire[7:0] pb_out_port;
  wire[7:0] pb_out_port;
 
 
  wire[17:0] instruction;
  wire[17:0] instruction;
  wire[9:0] address;
  wire[9:0] address;
 
 
  wire interrupt;
  wire interrupt;
  wire interrupt_ack;
  wire interrupt_ack;
 
 
  reg[23:0] timer;
  reg[23:0] timer;
 
 
  wire dcm_locked;
  wire dcm_locked;
 
 
  // 50 mhz clock generation
  // 50 mhz clock generation
  DCM_SP # (
  DCM_SP # (
    .CLK_FEEDBACK("NONE"),
    .CLK_FEEDBACK("NONE"),
    .CLKDV_DIVIDE(2.0),
    .CLKDV_DIVIDE(2.0),
    .CLKFX_DIVIDE(8),
    .CLKFX_DIVIDE(8),
    .CLKFX_MULTIPLY(25),
    .CLKFX_MULTIPLY(25),
    .CLKIN_DIVIDE_BY_2("FALSE"),
    .CLKIN_DIVIDE_BY_2("FALSE"),
    .CLKIN_PERIOD(62.500),
    .CLKIN_PERIOD(62.500),
    .CLKOUT_PHASE_SHIFT("NONE"),
    .CLKOUT_PHASE_SHIFT("NONE"),
    .DESKEW_ADJUST("SYSTEM_SYNCHRONOUS"),
    .DESKEW_ADJUST("SYSTEM_SYNCHRONOUS"),
    .DFS_FREQUENCY_MODE("LOW"),
    .DFS_FREQUENCY_MODE("LOW"),
    .DLL_FREQUENCY_MODE("LOW"),
    .DLL_FREQUENCY_MODE("LOW"),
    .DUTY_CYCLE_CORRECTION("TRUE"),
    .DUTY_CYCLE_CORRECTION("TRUE"),
    .FACTORY_JF(16'hC080),
    .FACTORY_JF(16'hC080),
    .PHASE_SHIFT(0),
    .PHASE_SHIFT(0),
    .STARTUP_WAIT("FALSE")
    .STARTUP_WAIT("FALSE")
  )
  )
  DCM_SP_INST (
  DCM_SP_INST (
    .CLKFB(1'B0),
    .CLKFB(1'B0),
    .CLKIN(CLK_16MHZ),
    .CLKIN(CLK_16MHZ),
    .DSSEN(1'B0),
    .DSSEN(1'B0),
    .PSCLK(1'B0),
    .PSCLK(1'B0),
    .PSEN(1'B0),
    .PSEN(1'B0),
    .PSINCDEC(1'B0),
    .PSINCDEC(1'B0),
    .RST(FPGA_RESET),
    .RST(FPGA_RESET),
    .CLKDV(),
    .CLKDV(),
    .CLKFX(clk),
    .CLKFX(clk),
    .CLKFX180(),
    .CLKFX180(),
    .CLK0(),
    .CLK0(),
    .CLK2X(),
    .CLK2X(),
    .CLK2X180(),
    .CLK2X180(),
    .CLK90(),
    .CLK90(),
    .CLK180(),
    .CLK180(),
    .CLK270(),
    .CLK270(),
    .LOCKED(dcm_locked),
    .LOCKED(dcm_locked),
    .PSDONE(),
    .PSDONE(),
    .STATUS()
    .STATUS()
  );
  );
 
 
  // reset synchronisation
  // reset synchronisation
  always@(negedge dcm_locked or posedge clk)
  always@(negedge dcm_locked or posedge clk)
    if (! dcm_locked)
    if (! dcm_locked)
      rst <= 1'b1;
      rst <= 1'b1;
    else
    else
      rst <= ! dcm_locked;
      rst <= ! dcm_locked;
 
 
  // module instances
  // module instances
  ///////////////////
  ///////////////////
 
 
  kcpsm3 inst_kcpsm3 (
  kcpsm3 inst_kcpsm3 (
    .address(address),
    .address(address),
    .instruction(instruction),
    .instruction(instruction),
    .port_id(pb_port_id),
    .port_id(pb_port_id),
    .write_strobe(pb_write_strobe),
    .write_strobe(pb_write_strobe),
    .out_port(pb_out_port),
    .out_port(pb_out_port),
    .read_strobe(pb_read_strobe),
    .read_strobe(pb_read_strobe),
    .in_port(pb_in_port),
    .in_port(pb_in_port),
    .interrupt(interrupt),
    .interrupt(interrupt),
    .interrupt_ack(interrupt_ack),
    .interrupt_ack(interrupt_ack),
    .reset(rst),
    .reset(rst),
    .clk(clk)
    .clk(clk)
  );
  );
 
 
  pbwbuart inst_pbwbuart (
  pbwbuart inst_pbwbuart (
    .address(address),
    .address(address),
    .instruction(instruction),
    .instruction(instruction),
    .clk(clk)
    .clk(clk)
  );
  );
 
 
  wbm_picoblaze inst_wbm_picoblaze (
  wbm_picoblaze inst_wbm_picoblaze (
    .rst(rst),
    .rst(rst),
    .clk(clk),
    .clk(clk),
 
 
    .wbm_cyc_o(wb_cyc),
    .wbm_cyc_o(wb_cyc),
    .wbm_stb_o(wb_stb),
    .wbm_stb_o(wb_stb),
    .wbm_we_o(wb_we),
    .wbm_we_o(wb_we),
    .wbm_adr_o(wb_adr),
    .wbm_adr_o(wb_adr),
    .wbm_dat_m2s_o(wb_dat_m2s),
    .wbm_dat_m2s_o(wb_dat_m2s),
    .wbm_dat_s2m_i(wb_dat_s2m),
    .wbm_dat_s2m_i(wb_dat_s2m),
    .wbm_ack_i(wb_ack),
    .wbm_ack_i(wb_ack),
 
 
    .pb_port_id_i(pb_port_id),
    .pb_port_id_i(pb_port_id),
    .pb_write_strobe_i(pb_write_strobe),
    .pb_write_strobe_i(pb_write_strobe),
    .pb_out_port_i(pb_out_port),
    .pb_out_port_i(pb_out_port),
    .pb_read_strobe_i(pb_read_strobe),
    .pb_read_strobe_i(pb_read_strobe),
    .pb_in_port_o(pb_in_port)
    .pb_in_port_o(pb_in_port)
  );
  );
 
 
  wbs_uart inst_wbs_uart (
  wbs_uart inst_wbs_uart (
    .rst(rst),
    .rst(rst),
    .clk(clk),
    .clk(clk),
 
 
    .wbs_cyc_i(wb_cyc),
    .wbs_cyc_i(wb_cyc),
    .wbs_stb_i(wb_stb),
    .wbs_stb_i(wb_stb),
    .wbs_we_i(wb_we),
    .wbs_we_i(wb_we),
    .wbs_adr_i(wb_adr),
    .wbs_adr_i(wb_adr),
    .wbs_dat_m2s_i(wb_dat_m2s),
    .wbs_dat_m2s_i(wb_dat_m2s),
    .wbs_dat_s2m_o(wb_dat_s2m),
    .wbs_dat_s2m_o(wb_dat_s2m),
    .wbs_ack_o(wb_ack),
    .wbs_ack_o(wb_ack),
 
 
    .uart_rx_si_i(UART_TXD),
    .uart_rx_si_i(UART_TXD),
    .uart_tx_so_o(UART_RXD)
    .uart_tx_so_o(UART_RXD)
  );
  );
 
 
  assign LED1 = timer[23];
  assign LED1 = timer[23];
 
 
  always@(posedge clk) begin : led_blinker
  always@(posedge clk) begin : led_blinker
    timer <= timer + 1;
    timer <= timer + 1;
    if (rst)
    if (rst)
      timer <= {24{1'b0}};
      timer <= {24{1'b0}};
  end
  end
 
 
endmodule
endmodule
 
 

powered by: WebSVN 2.1.0

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