Compare commits

..

31 Commits

Author SHA1 Message Date
8cccea85e0 Added adc->dac path test 2026-03-04 23:35:02 +01:00
3c13e3289a Merge branch 'new_structure' 2026-03-02 19:38:21 +01:00
105dbed8e4 Added back in the jtag bridge
Now talking over the bus instead of using dpram
2026-02-27 17:39:43 +01:00
6f680377db jtag memory selectable 2026-02-27 16:09:33 +01:00
3a9b2acf9e New wishbone-jtag bridge 2026-02-27 15:56:56 +01:00
838204653a TImer working with tests
TODO: think of other way of shifting in data. Bit errors make uploading difficult
2026-02-25 22:01:28 +01:00
3a3c951409 Added timer, still wip 2026-02-25 20:54:12 +01:00
f2f9644830 Added qerv files 2026-02-25 20:52:07 +01:00
13f72e698f jtag memory interface working 2026-02-25 16:14:37 +01:00
9930ce4461 Working CPP way of writing data 2026-02-24 16:40:17 +01:00
8f4e887b9d Added JTAG interface with testbench 2026-02-23 15:37:49 +01:00
20cfece6e3 Added soclet with gpio banks to top 2026-02-22 20:00:42 +01:00
a97028c2ba cleanup 2026-02-22 18:49:03 +01:00
5e951f9b61 Working SERV cpu 2026-02-22 18:48:17 +01:00
ac6aea90b6 Merge branch 'master' of ssh://git.joppeb.nl:222/joppe/fpga_modem 2026-02-22 16:07:34 +01:00
dc946cd793 Moved serv to own tree 2026-02-22 16:03:21 +01:00
a261264fda Added serv and made a blinky testbench for it 2026-02-21 19:24:18 +01:00
Joppe Blondel
49b8a77480 Combined all sigmadelta things to one input block 2025-10-19 20:03:51 +02:00
Joppe Blondel
165faefa59 Added decimation 2025-10-19 17:26:09 +02:00
Joppe Blondel
771fa58769 Added K IIR lpf filter 2025-10-19 17:02:29 +02:00
Joppe Blondel
b2858ac5ee Added mul tb and fixed 2025-10-19 16:18:40 +02:00
Joppe Blondel
eb7caaf2c5 Added PLL/clock generator and SD RC model 2025-10-19 15:36:55 +02:00
Joppe Blondel
3b04f3a6be Added lvds and sampler 2025-10-08 18:01:03 +02:00
Jojojoppe
324bb108e3 Added planahead script and fixed conversion 2025-10-06 16:49:28 +02:00
Jojojoppe
06ef70e1ee Improved NCO: 200MHz 2025-10-06 16:25:40 +02:00
Jojojoppe
1e9d7b7680 Got rid of ftw_we and tested on hw with freq sweep 2025-10-05 23:42:51 +02:00
Jojojoppe
83cc449c6f Using remotesyn and added NCO 2025-10-05 23:20:25 +02:00
Jojojoppe
639541728f Added decimator 2025-10-01 21:52:21 +02:00
Jojojoppe
e0151d093f Added sampler and RC model 2025-10-01 21:15:20 +02:00
Jojojoppe
ee58fccba4 Added pll to simulation 2025-10-01 17:24:53 +02:00
Jojojoppe
42e9bd0a0a initial commit 2025-10-01 16:40:05 +02:00
8 changed files with 204 additions and 12 deletions

View File

@@ -5,10 +5,10 @@ module lvds_comparator_spartan6_impl (
); );
IBUFDS #( IBUFDS #(
.DIFF_TERM("FALSE"), .DIFF_TERM("FALSE"),
.IOSTANDARD("LVDS33") .IOSTANDARD("LVDS_33")
) lvds_buf ( ) lvds_buf (
.O(o), .O(o),
.I(a), .I(a),
.IB(b) .IB(b)
); );
endmodule endmodule

View File

@@ -91,11 +91,10 @@ module mcu_peripherals (
); );
wb_gpio_banks #( wb_gpio_banks #(
.BASE_ADDR(GPIO_BASE_ADDR), .num_banks(4)
.NUM_BANKS(4)
) gpio ( ) gpio (
.i_wb_clk(i_clk), .i_clk(i_clk),
.i_wb_rst(i_rst), .i_rst(i_rst),
.i_wb_dat(gpio_wbs_dat_w), .i_wb_dat(gpio_wbs_dat_w),
.i_wb_adr(gpio_wbs_adr), .i_wb_adr(gpio_wbs_adr),
.i_wb_we(gpio_wbs_we), .i_wb_we(gpio_wbs_we),

View File

@@ -0,0 +1,54 @@
# Main clock input
NET "aclk" LOC = P126;
NET "aclk" TNM_NET = "SYS_CLK_PIN";
TIMESPEC TS_SYS_CLK_PIN = PERIOD "SYS_CLK_PIN" 10 ns HIGH 50 %;
# Boards button row
NET "aresetn" LOC = P120;
NET "aresetn" IOSTANDARD = LVCMOS33;
NET "aresetn" PULLUP;
NET "adc_a" LOC = P33;
NET "adc_a" IOSTANDARD = LVDS_33;
NET "adc_b" LOC = P32;
NET "adc_b" IOSTANDARD = LVDS_33;
NET "adc_o" LOC = P34;
NET "adc_o" IOSTANDARD = LVCMOS33;
NET "r2r[0]" LOC = P131;
NET "r2r[1]" LOC = P133;
NET "r2r[2]" LOC = P137;
NET "r2r[3]" LOC = P139;
NET "r2r[4]" LOC = P141;
NET "r2r[5]" LOC = P1;
NET "r2r[0]" IOSTANDARD = LVCMOS33;
NET "r2r[1]" IOSTANDARD = LVCMOS33;
NET "r2r[2]" IOSTANDARD = LVCMOS33;
NET "r2r[3]" IOSTANDARD = LVCMOS33;
NET "r2r[4]" IOSTANDARD = LVCMOS33;
NET "r2r[5]" IOSTANDARD = LVCMOS33;
NET "LED[0]" LOC = P119;
NET "LED[0]" IOSTANDARD = LVCMOS33;
NET "LED[0]" DRIVE = 8;
NET "LED[1]" LOC = P118;
NET "LED[1]" IOSTANDARD = LVCMOS33;
NET "LED[1]" DRIVE = 8;
NET "LED[2]" LOC = P117;
NET "LED[2]" IOSTANDARD = LVCMOS33;
NET "LED[2]" DRIVE = 8;
NET "LED[3]" LOC = P116;
NET "LED[3]" IOSTANDARD = LVCMOS33;
NET "LED[3]" DRIVE = 8;
NET "LED[4]" LOC = P115;
NET "LED[4]" IOSTANDARD = LVCMOS33;
NET "LED[4]" DRIVE = 8;
NET "LED[5]" LOC = P114;
NET "LED[5]" IOSTANDARD = LVCMOS33;
NET "LED[5]" DRIVE = 8;
NET "LED[6]" LOC = P112;
NET "LED[6]" IOSTANDARD = LVCMOS33;
NET "LED[6]" DRIVE = 8;
NET "LED[7]" LOC = P111;
NET "LED[7]" IOSTANDARD = LVCMOS33;
NET "LED[7]" DRIVE = 8;

View File

@@ -0,0 +1,46 @@
CAPI=2:
name: joppeb:system:mimas_sd_adc_r2r:1.0
description: Mimas top-level wiring sigma-delta ADC output directly to R2R DAC
filesets:
rtl:
depend:
- joppeb:primitive:clkgen
- joppeb:signal:sd_adc_q15
- joppeb:util:conv
files:
- rtl/toplevel.v
file_type: verilogSource
mimas:
files:
- mimas.ucf : {file_type : UCF}
- options.tcl : {file_type : tclSource}
targets:
default:
filesets:
- rtl
toplevel: toplevel
mimas:
filesets:
- rtl
- mimas
toplevel: toplevel
parameters:
- FPGA_SPARTAN6=true
default_tool: ise
tools:
ise:
family: Spartan6
device: xc6slx9
package: tqg144
speed: -2
parameters:
FPGA_SPARTAN6:
datatype: bool
description: Select Spartan-6 family specific implementations
paramtype: vlogdefine

View File

@@ -0,0 +1,2 @@
project set "Create Binary Configuration File" TRUE -process "Generate Programming File"
project set "Keep Hierarchy" Yes -process "Synthesize - XST"

View File

@@ -0,0 +1,91 @@
`timescale 1ns/1ps
module toplevel(
input wire aclk,
input wire aresetn,
input wire adc_a,
input wire adc_b,
output wire adc_o,
output wire [5:0] r2r,
output wire [7:0] LED
);
`include "conv.vh"
// Clocking
wire clk_100;
assign clk_100 = aclk;
wire clk_15;
clkgen #(
.CLK_IN_HZ(100000000),
.CLKFX_DIVIDE(20),
.CLKFX_MULTIPLY(3)
) clk_gen_15 (
.clk_in(clk_100),
.clk_out(clk_15)
);
// Asynchronous assert on reset button, synchronous release in clk_15 domain.
localparam [17:0] RESET_RELEASE_CYCLES = 18'd150000; // ~10 ms @ 15 MHz
reg [17:0] rst_cnt = 18'd0;
reg sys_reset_r = 1'b1;
always @(posedge clk_15 or negedge aresetn) begin
if (!aresetn) begin
rst_cnt <= 18'd0;
sys_reset_r <= 1'b1;
end else if (sys_reset_r) begin
if (rst_cnt == RESET_RELEASE_CYCLES - 1'b1)
sys_reset_r <= 1'b0;
else
rst_cnt <= rst_cnt + 1'b1;
end
end
wire signed [15:0] signal_q15;
wire signal_valid;
sd_adc_q15 #(
.R_OHM(3300),
.C_PF(220)
) sd_adc (
.i_clk_15(clk_15),
.i_rst_n(!sys_reset_r),
.i_adc_a(adc_a),
.i_adc_b(adc_b),
.o_adc(adc_o),
.o_signal_q15(signal_q15),
.o_signal_valid(signal_valid)
);
// signal_q15 is unipolar and biased (0-3.3V -> 0..32767)
reg signed [15:0] signal_unbiased_q15 = 16'sd0;
reg signal_unbiased_valid = 1'b0;
localparam bias = 2**14;
localparam gain = 2;
always @(posedge clk_15) begin
if (sys_reset_r) begin
signal_unbiased_q15 <= 16'sd0;
signal_unbiased_valid <= 1'b0;
end else begin
signal_unbiased_valid <= signal_valid;
if (signal_valid) begin
signal_unbiased_q15 <= (signal_q15 - $signed(bias)) * gain;
end
end
end
reg [5:0] dac_code = 6'd0;
always @(posedge clk_15) begin
if (sys_reset_r)
dac_code <= 6'd0;
else if (signal_unbiased_valid)
dac_code <= q15_to_uq16(signal_unbiased_q15) >> 10;
end
assign r2r = dac_code;
// Quick status indication: show ADC validity and most recent DAC code.
assign LED[0] = signal_valid;
assign LED[6:1] = dac_code;
assign LED[7] = sys_reset_r;
endmodule

View File

@@ -35,13 +35,13 @@ void main(){
irq_init(); irq_init();
*LEDGR = 1; *LEDGR = 1;
*TIMER_LD = 2 * 15000000/1000; *TIMER_LD = 1000 * 15000;
for(;;){ for(;;){
for(int i=1000; i<10000; i+=10){ for(int i=500; i<6000; i+=10){
*R_FREQ = i; *R_FREQ = i;
*LEDS = i>>4; *LEDS = i>>4;
// for(int j=0; j<80; j++) asm volatile("nop"); for(int j=0; j<800; j++) asm volatile("nop");
} }
} }
} }

View File

@@ -13,7 +13,7 @@ module wb_gpio_banks #(
input wire i_wb_we, input wire i_wb_we,
input wire i_wb_cyc, input wire i_wb_cyc,
input wire i_wb_stb, input wire i_wb_stb,
output wire o_wb_ack, output reg o_wb_ack,
input wire [num_banks*32-1:0] i_gpio, input wire [num_banks*32-1:0] i_gpio,
output wire [num_banks*32-1:0] o_gpio output wire [num_banks*32-1:0] o_gpio
@@ -48,8 +48,8 @@ module wb_gpio_banks #(
integer bi; integer bi;
always @* begin always @* begin
o_wb_rdt = 0; o_wb_rdt = 32'h00000000;
o_wb_ack = 0; o_wb_ack = 1'b0;
for(bi=0; bi<num_banks; bi=bi+1) begin for(bi=0; bi<num_banks; bi=bi+1) begin
if(bank_sel[bi]) begin if(bank_sel[bi]) begin
o_wb_rdt = bank_rdt[bi*32 +: 32]; o_wb_rdt = bank_rdt[bi*32 +: 32];