Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b315119
Hand translate FIFO module with random input testbench
coreyqh Oct 7, 2025
f5e1ad8
Add scripts to run fifo TB in vivado
coreyqh Oct 7, 2025
ae8bb03
Merge pull request #1 from coreyqh/sigGenSV
troyrkaufman Oct 7, 2025
cf4b81a
Fix paths in tcl script
coreyqh Oct 7, 2025
1ab900c
separate xvhdl and xvlog commands in tcl script
coreyqh Oct 7, 2025
74be5c9
Syntax debug
coreyqh Oct 7, 2025
d32d361
Further syntax debug
coreyqh Oct 7, 2025
3410f74
merge from old repo
jesliu-27 Oct 7, 2025
1141bf2
bmem testbenched !
abe-3 Oct 7, 2025
34f1468
Simplify testbench flow
coreyqh Oct 7, 2025
3c8d2cd
semicolon
coreyqh Oct 7, 2025
8d12960
bram instance name
coreyqh Oct 7, 2025
887b307
Merge branch 'openquantumhardware:main' into SigGen
coreyqh Oct 7, 2025
639cc86
Merge pull request #3 from abe-3/sig_gen
coreyqh Oct 7, 2025
0912ef2
Major typo fix
coreyqh Oct 7, 2025
3e6bf21
Fix bram synchronization issue
coreyqh Oct 7, 2025
7646e44
SV matching VHDL, weird reset mismatch with Xilinx IP
coreyqh Oct 7, 2025
a0e52a5
Translated VHDL to SystemVerilog files within the Sig Gen v6 director…
troyrkaufman Oct 8, 2025
b228cc5
notebook for generating .mem files without the RFSoC
jesliu-27 Oct 8, 2025
5518e91
nb for generating soccfg
jesliu-27 Oct 8, 2025
b7587e8
rename mem generation nb
jesliu-27 Oct 8, 2025
a7e9c78
bmem async test
abe-3 Oct 9, 2025
69160ea
fix sig_gen https://github.com/openquantumhardware/qick/pull/370/file…
jesliu-27 Oct 9, 2025
eeb88dd
Moved VHDL to SV translation files to correct directory and made bit …
troyrkaufman Oct 9, 2025
c3775ff
Merge pull request #4 from troyrkaufman/SigGen
coreyqh Oct 9, 2025
65d5ba5
remove duplicate files
coreyqh Oct 9, 2025
2a5e7b1
Merge branch 'sigGenSV' of https://github.com/coreyqh/qick into SigGenSV
coreyqh Oct 9, 2025
ea470e1
renaming bram files for consistency, added directory comments to tb
abe-3 Oct 9, 2025
365c895
Merge pull request #6 from coreyqh/SigGenSV
coreyqh Oct 9, 2025
2272795
Merge pull request #5 from abe-3/sig_gen
coreyqh Oct 9, 2025
79d7518
Revert "Behavioral XPM FIFO model and various houskeeping"
coreyqh Oct 9, 2025
69f25ac
Merge pull request #7 from hrl-labs-clinic-25-26/revert-6-SigGenSV
coreyqh Oct 9, 2025
e35b3d0
Merge pull request #8 from coreyqh/SigGenSV
coreyqh Oct 9, 2025
6075785
Updated file names and replaced xilinx instantiations
troyrkaufman Oct 9, 2025
5559a53
Merge pull request #9 from jesliu-27/emulator_nb_interface
jesliu-27 Oct 9, 2025
7f259d2
Incorporating syntax fixes
troyrkaufman Oct 9, 2025
6c0a78d
Merge pull request #10 from troyrkaufman/SigGen
troyrkaufman Oct 9, 2025
288d1d5
tb for sig-gen only
jesliu-27 Oct 13, 2025
1deeb67
Merge pull request #1 from jesliu-27/axis_sig_gen_v6
jesliu-27 Oct 13, 2025
03d1e36
tb dac+ sig gen set up
jesliu-27 Oct 14, 2025
ff8698a
Merge pull request #2 from jesliu-27/axis_sig_gen_v6
jesliu-27 Oct 14, 2025
f511023
fix typo, simulation can run
jesliu-27 Oct 14, 2025
4957e3b
tb xpr files
jesliu-27 Oct 14, 2025
9feee71
daily commit for tb
jesliu-27 Oct 16, 2025
cf2cb13
sync qick_lib from qick upstream
jesliu-27 Oct 16, 2025
52cf3dd
Merge branch 'main' into axis_sig_gen_v6
jesliu-27 Oct 16, 2025
e27130c
Merge pull request #3 from jesliu-27/axis_sig_gen_v6
jesliu-27 Oct 16, 2025
f5f2f7e
dac_sig tb
jesliu-27 Oct 16, 2025
f04e8d8
Fifos match except for strange out of reset behavior
coreyqh Oct 28, 2025
97bed61
Merge pull request #18 from coreyqh/SigGen
coreyqh Nov 6, 2025
f5b8f44
Merge branch 'SigGen' of https://github.com/hrl-labs-clinic-25-26/qic…
jesliu-27 Nov 6, 2025
04b1ebe
dds simulation folder
jesliu-27 Nov 7, 2025
ecb83b9
updated dds tb
jesliu-27 Nov 7, 2025
6ffac6b
delete incorrect files
jesliu-27 Nov 7, 2025
52548d4
updated dds code
jesliu-27 Nov 7, 2025
a27d886
Merge pull request #4 from jesliu-27/axis_sig_gen_v6
jesliu-27 Nov 7, 2025
73f91ed
tb for dds
jesliu-27 Nov 10, 2025
4831af8
Merge pull request #5 from jesliu-27/axis_sig_gen_v6
jesliu-27 Nov 10, 2025
f5c1cc2
Merge pull request #40 from jesliu-27/main
jesliu-27 Nov 10, 2025
007c47b
fixed tvalid issue
jesliu-27 Nov 13, 2025
63013c9
dds most updated xpr simulation
jesliu-27 Nov 13, 2025
defe8a4
Merge pull request #42 from jesliu-27/axis_sig_gen_v6
jesliu-27 Nov 13, 2025
e9a3dd8
[hrl-labs-clinic-25-26/qick#46] Added Andrew's demo notebook
mmdiego Feb 10, 2026
0a040aa
Merge pull request #48 from mmdiego/46-demo-notebook-to-use-as-refere…
mmdiego Feb 10, 2026
163b04e
restore original signal generator v6 code base, relocating new/modifi…
coreyqh Feb 17, 2026
ca70e71
Update to openquantumhardware/main to clean hrl-labs-clinic-25-26/main
coreyqh Feb 17, 2026
f4b42be
move software items to emulator/software
coreyqh Feb 17, 2026
e38a381
move DDS model to emulator directory
coreyqh Feb 17, 2026
daf9411
move openhdl models to emulator/models directory
coreyqh Feb 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
395 changes: 395 additions & 0 deletions emulator/models/axis_signal_gen_v6/axi_slv_sg_v6_sv.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,395 @@
// axi_slv_sg_v6.sv
//

module axi_slv_sg_v6_sv #(parameter DATA_WIDTH = 32, parameter ADDR_WIDTH = 6)(
input logic aclk,
input logic aresetn,

// Write Address Channel
input logic [ADDR_WIDTH-1:0] awaddr,
input logic [2:0] awprot,
input logic awvalid,
output logic awready,

// Write Data Channel
input logic [DATA_WIDTH-1:0] wdata,
input logic [(DATA_WIDTH/8)-1:0] wstrb,
input logic wvalid,
output logic wready,

// Write Response Channel
output logic [1:0] bresp,
output logic bvalid,
input logic bready,

// Read Address Channel
input [ADDR_WIDTH-1:0] araddr,
input [2:0] arprot,
input arvalid,
output arready,

// Read Data Channel
output logic [DATA_WIDTH-1:0] rdata,
output logic [1:0] rresp,
output logic rvalid,
input logic rready,

// Registers
output logic [31:0] START_ADDR_REG,
output logic WE_REG
);

logic [ADDR_WIDTH-1:0] axi_awaddr;
logic axi_awready;
logic axi_wready;
logic [1:0] axi_bresp;
logic axi_bvalid;
logic [ADDR_WIDTH-1:0] axi_araddr;
logic axi_arready;
logic [DATA_WIDTH-1:0] axi_rdata;
logic [1:0] axi_rresp;
logic axi_rvalid;

localparam int ADDR_LSB = (DATA_WIDTH/32)+1;
localparam int OPT_MEM_ADDR_BITS = 3;

// Number of Slave Registers 16
logic [DATA_WIDTH-1:0] slv_reg0;
logic [DATA_WIDTH-1:0] slv_reg1;
logic [DATA_WIDTH-1:0] slv_reg2;
logic [DATA_WIDTH-1:0] slv_reg3;
logic [DATA_WIDTH-1:0] slv_reg4;
logic [DATA_WIDTH-1:0] slv_reg5;
logic [DATA_WIDTH-1:0] slv_reg6;
logic [DATA_WIDTH-1:0] slv_reg7;
logic [DATA_WIDTH-1:0] slv_reg8;
logic [DATA_WIDTH-1:0] slv_reg9;
logic [DATA_WIDTH-1:0] slv_reg10;
logic [DATA_WIDTH-1:0] slv_reg11;
logic [DATA_WIDTH-1:0] slv_reg12;
logic [DATA_WIDTH-1:0] slv_reg13;
logic [DATA_WIDTH-1:0] slv_reg14;
logic [DATA_WIDTH-1:0] slv_reg15;
logic slv_reg_rden;
logic slv_reg_wren;
logic [DATA_WIDTH-1:0] reg_data_out;
int bte_index;
logic aw_en;

//I/O Connections assignments
assign awready = axi_awready;
assign wready = axi_wready;
assign bresp = axi_bresp;
assign bvalid = axi_bvalid;
assign arready = axi_arready;
assign rdata = axi_rdata;
assign rresp = axi_rresp;
assign rvalid = axi_rvalid;

always_ff@(posedge aclk) begin
if (~aresetn) begin
axi_awready <= 0;
aw_en <= 0;
end else begin
if (axi_awready == 0 && awvalid == 1 && wvalid == 1 && aw_en == 1) begin
axi_awready <= 1;
aw_en <= 0;
end else if (bready == 1 && axi_bvalid == 1) begin
axi_awready <= 0;
aw_en <= 1;
end else
axi_awready <= 0;
end
end

// Implement axi_awaddr latching
always_ff@(posedge aclk) begin
if (~aresetn) begin
axi_awaddr <= 0;
end else begin
if (axi_awready == 0 && awvalid == 1 && wvalid == 1 && aw_en == 1) begin
axi_awaddr <= awaddr;
end
end
end

// Implement axi_wready generation
always_ff@(posedge aclk) begin
if (~aresetn) begin
axi_wready <= 0;
end else begin
if (axi_wready == 0 && wvalid == 1 && awvalid == 1 && aw_en) begin
axi_wready <= 1;
end else begin
axi_wready <= 0;
end
end
end

// Implement memory mapped register select and write logic generation
assign slv_reg_wren = axi_wready && wvalid && axi_awready && awvalid;

always_ff@(posedge aclk) begin : decoding_regs_aclk
logic [OPT_MEM_ADDR_BITS:0] loc_addr;
if (~aresetn) begin
slv_reg0 <= 0;
slv_reg1 <= 0;
slv_reg2 <= 0;
slv_reg3 <= 0;
slv_reg4 <= 0;
slv_reg5 <= 0;
slv_reg6 <= 0;
slv_reg7 <= 0;
slv_reg8 <= 0;
slv_reg9 <= 0;
slv_reg10 <= 0;
slv_reg11 <= 0;
slv_reg12 <= 0;
slv_reg13 <= 0;
slv_reg14 <= 0;
slv_reg15 <= 0;
end else begin
loc_addr <= axi_awaddr[(ADDR_LSB + OPT_MEM_ADDR_BITS):ADDR_LSB];

if (slv_reg_wren) begin
case (loc_addr)
'b0000: begin
for (int byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg0[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b0001: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg1[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b0010: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg2[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b0011: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg3[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b0100: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg4[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b0101: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg5[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b0110: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg6[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b0111: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg7[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1000: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg8[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1001: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg9[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1010: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg10[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1011: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg11[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1100: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg12[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1101: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg13[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1110: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg14[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
4'b1111: begin
int byte_index; // procedural loop variable
for (byte_index = 0; byte_index < (DATA_WIDTH/8); byte_index++) begin
if (wstrb[byte_index]) begin
slv_reg15[(byte_index*8) +: 8] <= wdata[(byte_index*8) +: 8];
end
end
end
default: begin
slv_reg0 <= slv_reg0;
slv_reg1 <= slv_reg1;
slv_reg2 <= slv_reg2;
slv_reg3 <= slv_reg3;
slv_reg4 <= slv_reg4;
slv_reg5 <= slv_reg5;
slv_reg6 <= slv_reg6;
slv_reg7 <= slv_reg7;
slv_reg8 <= slv_reg8;
slv_reg9 <= slv_reg9;
slv_reg10 <= slv_reg10;
slv_reg11 <= slv_reg11;
slv_reg12 <= slv_reg12;
slv_reg13 <= slv_reg13;
slv_reg14 <= slv_reg14;
slv_reg15 <= slv_reg15;
end
endcase
end
end
end

// Implement write response logic generation
always_ff@(posedge aclk) begin
if (~aresetn) begin
axi_bvalid <= 0;
axi_bresp <= 0;
end else begin
if (axi_awready == 1 && awvalid == 1 && axi_wready == 1 && wvalid == 1 && axi_bvalid == 0) begin
axi_bvalid <= 1;
axi_bresp <= 0;
end else if (bready == 1 && axi_bvalid == 1) begin
axi_bvalid <= 0;
end
end
end

// Implement axi_arready generation
always_ff@(posedge aclk) begin
if (~aresetn) begin
axi_arready <= 0;
axi_araddr <= 1;
end else begin
if (axi_arready == 0 && arvalid == 1) begin
axi_arready <= 1;
axi_araddr <= araddr;
end else
axi_araddr <= 0;
end
end

// Implement axi_arvalid generation
always_ff@(posedge aclk) begin
if(~aresetn) begin
axi_rvalid <= 0;
axi_rresp <= 0;
end else begin
if (axi_arready == 1 && arvalid == 1 && axi_rvalid == 0) begin
axi_rvalid <= 1;
axi_rresp <= 0;
end else if (axi_rvalid == 1 && rready == 1)
axi_rvalid <= 0;
end
end

// Implement memory mapped register select and read logic generation
assign slv_reg_rden = axi_arready && arvalid && (~axi_rvalid);

always_comb begin : decoding_regs_no_aclk
logic [OPT_MEM_ADDR_BITS:ADDR_LSB] loc_addr;

case (loc_addr)
'b0000: reg_data_out = slv_reg0;
'b0001: reg_data_out = slv_reg1;
'b0010: reg_data_out = slv_reg2;
'b0011: reg_data_out = slv_reg3;
'b0100: reg_data_out = slv_reg4;
'b0101: reg_data_out = slv_reg5;
'b0110: reg_data_out = slv_reg6;
'b0111: reg_data_out = slv_reg7;
'b1000: reg_data_out = slv_reg8;
'b1001: reg_data_out = slv_reg9;
'b1010: reg_data_out = slv_reg10;
'b1011: reg_data_out = slv_reg11;
'b1100: reg_data_out = slv_reg12;
'b1101: reg_data_out = slv_reg13;
'b1110: reg_data_out = slv_reg14;
'b1111: reg_data_out = slv_reg15;
default:reg_data_out = 0;
endcase
end

// Output register or memory read data
always_ff@(posedge aclk) begin
if (~aresetn) begin
axi_rdata <= 0;
end else begin
if (slv_reg_rden) begin
axi_rdata <= reg_data_out;
end
end
end

// Register Map.
// 0 : START_ADDR_REG : 32-bit. Start address to write into memory.
// 1 : WE_REG : 1-bit. Enable write into memory.

// Output registers
assign START_ADDR_REG = slv_reg0;
assign WE_REG = slv_reg1;

endmodule
Loading
Loading