File: rfnoc_block_siggen.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 (242 lines) | stat: -rw-r--r-- 9,216 bytes parent folder | download | duplicates (3)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
//
// Copyright 2020 Ettus Research, a National Instruments Brand
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//
// Module: rfnoc_block_siggen
//
// Description:
//
//   Signal generator RFNoC block. This block outputs packets of one of three
//   output types based on the REG_WAVEFORM register setting. Supported modes
//   include constant, sinusoidal, and noise/random. The output is also run
//   through a gain stage that is configurable using the REG_GAIN register.
//   See the register descriptions in rfnoc_block_siggen_regs.vh for details.
//
//   The sine output is based on the Xilinx CORDIC IP, configured for the
//   rotate function, with scaled radians as the units. See the CORDIC user
//   guide (PG105) and register descriptions for details.
//
// Parameters:
//
//   THIS_PORTID : Control crossbar port to which this block is connected
//   CHDR_W      : AXIS-CHDR data bus width
//   MTU         : Maximum transmission unit (i.e., maximum packet size in
//                 CHDR words is 2**MTU).
//   NUM_PORTS   : Number of siggen cores to instantiate.
//

`default_nettype none


module rfnoc_block_siggen #(
  parameter [9:0] THIS_PORTID = 10  'd0,
  parameter       CHDR_W      = 64,
  parameter [5:0] MTU         = 10,
  parameter       NUM_PORTS   = 1
) (
  // RFNoC Framework Clocks and Resets
  input  wire                        rfnoc_chdr_clk,
  input  wire                        rfnoc_ctrl_clk,
  input  wire                        ce_clk,
  // RFNoC Backend Interface
  input  wire [               511:0] rfnoc_core_config,
  output wire [               511:0] rfnoc_core_status,
  // AXIS-CHDR Input Ports (from framework)
  input  wire [          CHDR_W-1:0] s_rfnoc_chdr_tdata,
  input  wire                        s_rfnoc_chdr_tlast,
  input  wire                        s_rfnoc_chdr_tvalid,
  output wire                        s_rfnoc_chdr_tready,
  // AXIS-CHDR Output Ports (to framework)
  output wire [NUM_PORTS*CHDR_W-1:0] m_rfnoc_chdr_tdata,
  output wire [       NUM_PORTS-1:0] m_rfnoc_chdr_tlast,
  output wire [       NUM_PORTS-1:0] m_rfnoc_chdr_tvalid,
  input  wire [       NUM_PORTS-1:0] m_rfnoc_chdr_tready,
  // AXIS-Ctrl Input Port (from framework)
  input  wire [                31:0] s_rfnoc_ctrl_tdata,
  input  wire                        s_rfnoc_ctrl_tlast,
  input  wire                        s_rfnoc_ctrl_tvalid,
  output wire                        s_rfnoc_ctrl_tready,
  // AXIS-Ctrl Output Port (to framework)
  output wire [                31:0] m_rfnoc_ctrl_tdata,
  output wire                        m_rfnoc_ctrl_tlast,
  output wire                        m_rfnoc_ctrl_tvalid,
  input  wire                        m_rfnoc_ctrl_tready
);

  `include "rfnoc_block_siggen_regs.vh"


  //---------------------------------------------------------------------------
  // Signal Declarations
  //---------------------------------------------------------------------------

  // CtrlPort Master
  wire        m_ctrlport_req_wr;
  wire        m_ctrlport_req_rd;
  wire [19:0] m_ctrlport_req_addr;
  wire [31:0] m_ctrlport_req_data;
  wire        m_ctrlport_resp_ack;
  wire [31:0] m_ctrlport_resp_data;
  // Data Stream to User Logic: out
  wire [NUM_PORTS*32*1-1:0] s_out_axis_tdata;
  wire [     NUM_PORTS-1:0] s_out_axis_tlast;
  wire [     NUM_PORTS-1:0] s_out_axis_tvalid;
  wire [     NUM_PORTS-1:0] s_out_axis_tready;
  wire [  NUM_PORTS*16-1:0] s_out_axis_tlength;


  //---------------------------------------------------------------------------
  // NoC Shell
  //---------------------------------------------------------------------------

  wire ce_rst;

  noc_shell_siggen #(
    .CHDR_W      (CHDR_W),
    .THIS_PORTID (THIS_PORTID),
    .MTU         (MTU),
    .NUM_PORTS   (NUM_PORTS)
  ) noc_shell_siggen_i (
    //---------------------
    // Framework Interface
    //---------------------

    // Clock Inputs
    .rfnoc_chdr_clk        (rfnoc_chdr_clk),
    .rfnoc_ctrl_clk        (rfnoc_ctrl_clk),
    .ce_clk                (ce_clk),
    // Reset Outputs
    .rfnoc_chdr_rst        (),
    .rfnoc_ctrl_rst        (),
    .ce_rst                (ce_rst),
    // RFNoC Backend Interface
    .rfnoc_core_config     (rfnoc_core_config),
    .rfnoc_core_status     (rfnoc_core_status),
    // CHDR Input Ports  (from framework)
    .s_rfnoc_chdr_tdata    (s_rfnoc_chdr_tdata),
    .s_rfnoc_chdr_tlast    (s_rfnoc_chdr_tlast),
    .s_rfnoc_chdr_tvalid   (s_rfnoc_chdr_tvalid),
    .s_rfnoc_chdr_tready   (s_rfnoc_chdr_tready),
    // CHDR Output Ports (to framework)
    .m_rfnoc_chdr_tdata    (m_rfnoc_chdr_tdata),
    .m_rfnoc_chdr_tlast    (m_rfnoc_chdr_tlast),
    .m_rfnoc_chdr_tvalid   (m_rfnoc_chdr_tvalid),
    .m_rfnoc_chdr_tready   (m_rfnoc_chdr_tready),
    // AXIS-Ctrl Input Port (from framework)
    .s_rfnoc_ctrl_tdata    (s_rfnoc_ctrl_tdata),
    .s_rfnoc_ctrl_tlast    (s_rfnoc_ctrl_tlast),
    .s_rfnoc_ctrl_tvalid   (s_rfnoc_ctrl_tvalid),
    .s_rfnoc_ctrl_tready   (s_rfnoc_ctrl_tready),
    // AXIS-Ctrl Output Port (to framework)
    .m_rfnoc_ctrl_tdata    (m_rfnoc_ctrl_tdata),
    .m_rfnoc_ctrl_tlast    (m_rfnoc_ctrl_tlast),
    .m_rfnoc_ctrl_tvalid   (m_rfnoc_ctrl_tvalid),
    .m_rfnoc_ctrl_tready   (m_rfnoc_ctrl_tready),

    //---------------------
    // Client Interface
    //---------------------

    // CtrlPort Clock and Reset
    .ctrlport_clk          (),
    .ctrlport_rst          (),
    // CtrlPort Master
    .m_ctrlport_req_wr     (m_ctrlport_req_wr),
    .m_ctrlport_req_rd     (m_ctrlport_req_rd),
    .m_ctrlport_req_addr   (m_ctrlport_req_addr),
    .m_ctrlport_req_data   (m_ctrlport_req_data),
    .m_ctrlport_resp_ack   (m_ctrlport_resp_ack),
    .m_ctrlport_resp_data  (m_ctrlport_resp_data),

    // AXI-Stream Clock and Reset
    .axis_data_clk         (),
    .axis_data_rst         (),
    // Data Stream from User Logic: out
    .s_out_axis_tdata      (s_out_axis_tdata),
    .s_out_axis_tkeep      ({NUM_PORTS{1'b1}}),
    .s_out_axis_tlast      (s_out_axis_tlast),
    .s_out_axis_tvalid     (s_out_axis_tvalid),
    .s_out_axis_tready     (s_out_axis_tready),
    .s_out_axis_ttimestamp ({NUM_PORTS{64'b0}}),
    .s_out_axis_thas_time  ({NUM_PORTS{1'b0}}),
    .s_out_axis_tlength    (s_out_axis_tlength),
    .s_out_axis_teov       ({NUM_PORTS{1'b0}}),
    .s_out_axis_teob       ({NUM_PORTS{1'b0}})
  );


  //---------------------------------------------------------------------------
  // CtrlPort Splitter
  //---------------------------------------------------------------------------

  // Create a CtrlPort bus for each port instance

  wire [ 1*NUM_PORTS-1:0] ctrlport_req_wr;
  wire [ 1*NUM_PORTS-1:0] ctrlport_req_rd;
  wire [20*NUM_PORTS-1:0] ctrlport_req_addr;
  wire [32*NUM_PORTS-1:0] ctrlport_req_data;
  wire [ 1*NUM_PORTS-1:0] ctrlport_resp_ack;
  wire [32*NUM_PORTS-1:0] ctrlport_resp_data;

  ctrlport_decoder #(
    .NUM_SLAVES   (NUM_PORTS),
    .BASE_ADDR    (0),
    .SLAVE_ADDR_W (SIGGEN_ADDR_W)
  ) ctrlport_decoder_i (
    .ctrlport_clk            (ce_clk),
    .ctrlport_rst            (ce_rst),
    .s_ctrlport_req_wr       (m_ctrlport_req_wr),
    .s_ctrlport_req_rd       (m_ctrlport_req_rd),
    .s_ctrlport_req_addr     (m_ctrlport_req_addr),
    .s_ctrlport_req_data     (m_ctrlport_req_data),
    .s_ctrlport_req_byte_en  (4'hF),
    .s_ctrlport_req_has_time (1'b0),
    .s_ctrlport_req_time     (64'b0),
    .s_ctrlport_resp_ack     (m_ctrlport_resp_ack),
    .s_ctrlport_resp_status  (),
    .s_ctrlport_resp_data    (m_ctrlport_resp_data),
    .m_ctrlport_req_wr       (ctrlport_req_wr),
    .m_ctrlport_req_rd       (ctrlport_req_rd),
    .m_ctrlport_req_addr     (ctrlport_req_addr),
    .m_ctrlport_req_data     (ctrlport_req_data),
    .m_ctrlport_req_byte_en  (),
    .m_ctrlport_req_has_time (),
    .m_ctrlport_req_time     (),
    .m_ctrlport_resp_ack     (ctrlport_resp_ack),
    .m_ctrlport_resp_status  ({NUM_PORTS{2'b0}}),
    .m_ctrlport_resp_data    (ctrlport_resp_data)
  );


  //---------------------------------------------------------------------------
  // Port Instances
  //---------------------------------------------------------------------------

  genvar port;
  generate
    for (port = 0; port < NUM_PORTS; port = port+1) begin : gen_ports

      rfnoc_siggen_core rfnoc_siggen_core_i (
        .clk                  (ce_clk),
        .rst                  (ce_rst),
        .s_ctrlport_req_wr    (ctrlport_req_wr    [port* 1 +:  1]),
        .s_ctrlport_req_rd    (ctrlport_req_rd    [port* 1 +:  1]),
        .s_ctrlport_req_addr  (ctrlport_req_addr  [port*20 +: 20]),
        .s_ctrlport_req_data  (ctrlport_req_data  [port*32 +: 32]),
        .s_ctrlport_resp_ack  (ctrlport_resp_ack  [port* 1 +:  1]),
        .s_ctrlport_resp_data (ctrlport_resp_data [port*32 +: 32]),
        .m_tdata              (s_out_axis_tdata   [port*32 +: 32]),
        .m_tlast              (s_out_axis_tlast   [port* 1 +:  1]),
        .m_tvalid             (s_out_axis_tvalid  [port* 1 +:  1]),
        .m_tready             (s_out_axis_tready  [port* 1 +:  1]),
        .m_tlength            (s_out_axis_tlength [port*16 +: 16])
      );

    end
  endgenerate

endmodule // rfnoc_block_siggen


`default_nettype wire