File: ctrlport_terminator.v

package info (click to toggle)
uhd 4.8.0.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 183,172 kB
  • sloc: cpp: 279,415; python: 109,850; ansic: 103,348; vhdl: 57,230; tcl: 20,007; xml: 8,581; makefile: 2,863; sh: 2,797; pascal: 230; javascript: 120; csh: 94; asm: 20; perl: 11
file content (50 lines) | stat: -rw-r--r-- 1,627 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Copyright 2019 Ettus Research, A National Instruments Company
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//
// Module: ctrlport_terminator.v
// Description:
// Returns an error for all ctrlport requests in given address range.

module ctrlport_terminator #(
  parameter START_ADDRESS = 0, // first address to generate response for
  parameter LAST_ADDRESS = 32  // last address (including) to generate response for
)(
  //---------------------------------------------------------------
  // ControlPort slave
  //---------------------------------------------------------------
  input  wire        ctrlport_clk,
  input  wire        ctrlport_rst,
  input  wire        s_ctrlport_req_wr,
  input  wire        s_ctrlport_req_rd,
  input  wire [19:0] s_ctrlport_req_addr,
  input  wire [31:0] s_ctrlport_req_data,

  output  reg        s_ctrlport_resp_ack,
  output wire [ 1:0] s_ctrlport_resp_status,
  output wire [31:0] s_ctrlport_resp_data
);

`include "../core/ctrlport.vh"
//vhook_nowarn s_ctrlport_req_addr
//vhook_nowarn s_ctrlport_req_data

// drive acknowledgement on requests but not on reset
always @(posedge ctrlport_clk) begin
  if (ctrlport_clk) begin
    if (ctrlport_rst) begin
      s_ctrlport_resp_ack <= 1'b0;
    end else if ((s_ctrlport_req_addr >= START_ADDRESS) && (s_ctrlport_req_addr <= LAST_ADDRESS)) begin
      s_ctrlport_resp_ack <= s_ctrlport_req_wr | s_ctrlport_req_rd;
    end else begin
      s_ctrlport_resp_ack <= 1'b0;
    end
  end
end

// other outputs are fixed
assign s_ctrlport_resp_status = CTRL_STS_CMDERR;
assign s_ctrlport_resp_data = { CTRLPORT_DATA_W {1'b0}};

endmodule