Compare commits

..

3 commits

Author SHA1 Message Date
slederer
7751d85765 pcomp: Makefile bugfixes 2026-01-01 02:21:45 +01:00
slederer
caa07474f8 minor comment/documentation cleanups 2026-01-01 02:09:02 +01:00
slederer
a9412d1339 tdraudio: fix wiring for channel 2, irqctrl: increase delay 2026-01-01 02:07:36 +01:00
6 changed files with 13 additions and 17 deletions

View file

@ -37,7 +37,7 @@ It uses a fixed serial configuration of 115200 bps, 8 data bits, 1 stop bit, no
## Notes ## Notes
A 16 byte FIFO is used when receiving data. A 64 byte FIFO is used when receiving data.
When reading data, each byte needs to be acknowledged by writing the _C_ flag to the UART register. When reading data, each byte needs to be acknowledged by writing the _C_ flag to the UART register.

View file

@ -1,6 +1,6 @@
`timescale 1ns / 1ps `timescale 1ns / 1ps
module irqctrl #(IRQ_LINES = 3, IRQ_DELAY_WIDTH = 4) ( module irqctrl #(IRQ_LINES = 3, IRQ_DELAY_WIDTH = 8) (
input wire clk, input wire clk,
input wire [IRQ_LINES-1:0] irq_in, input wire [IRQ_LINES-1:0] irq_in,
input wire cs, input wire cs,

View file

@ -399,7 +399,10 @@ module stackcpu #(parameter ADDR_WIDTH = 32, WIDTH = 32,
// process irq // process irq
always @(posedge clk) always @(posedge clk)
begin begin
if(seq_state == MEM && irq_pending && !(ins_xfer & xfer_r2p)) // in FETCH state, clear irq_pending. // in MEM state, clear irq_pending, when nPC has been set to IV
// RET instruction is a special case because we need to use
// the new PC that is in mem_data
if(seq_state == MEM && irq_pending && !(ins_xfer && xfer_r2p))
irq_pending <= 0; irq_pending <= 0;
else else
irq_pending <= irq_pending || irq; // else set irq_pending when irq is high irq_pending <= irq_pending || irq; // else set irq_pending when irq is high

View file

@ -233,7 +233,7 @@ module tdraudio #(DATA_WIDTH=32) (
chan2_rd_data, amp_wr_data, chan2_rd_data, amp_wr_data,
chan2_rd_en, chan2_wr_en, chan2_rd_en, chan2_wr_en,
chan2_amp, chan2_amp,
chan2_irq, chan2_running); chan2_running, chan2_irq);
wavegen chan3(clk, reset, reg_sel, wavegen chan3(clk, reset, reg_sel,
chan3_rd_data, amp_wr_data, chan3_rd_data, amp_wr_data,

View file

@ -278,6 +278,9 @@ module top(
(io_slot == 4) ? tdraudio_rd_data: (io_slot == 4) ? tdraudio_rd_data:
`endif `endif
-1; -1;
irqctrl irqctrl0(`clock, irq_in, irqc_cs, mem_write_enable,
irqc_seten, irqc_rd_data0,
irq);
// CPU ----------------------------------------------------------------- // CPU -----------------------------------------------------------------
stackcpu cpu0(.clk(`clock), .rst(rst), .irq(irq), stackcpu cpu0(.clk(`clock), .rst(rst), .irq(irq),
@ -288,10 +291,6 @@ module top(
.mem_wait(mem_wait), .mem_wait(mem_wait),
.debug1(led1), .debug2(led2), .debug3(led3)); .debug1(led1), .debug2(led2), .debug3(led3));
// Interrupt Controller
irqctrl irqctrl0(`clock, irq_in, irqc_cs, mem_write_enable,
irqc_seten, irqc_rd_data0,
irq);
// count clock ticks // count clock ticks
// generate interrupt every 20nth of a second // generate interrupt every 20nth of a second

View file

@ -358,9 +358,7 @@
<Runs Version="1" Minor="22"> <Runs Version="1" Minor="22">
<Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7a35ticsg324-1L" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" Dir="$PRUNDIR/synth_1" IncludeInArchive="true" IsChild="false" AutoIncrementalDir="$PSRCDIR/utils_1/imports/synth_1" AutoRQSDir="$PSRCDIR/utils_1/imports/synth_1" ParallelReportGen="true"> <Run Id="synth_1" Type="Ft3:Synth" SrcSet="sources_1" Part="xc7a35ticsg324-1L" ConstrsSet="constrs_1" Description="Vivado Synthesis Defaults" AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" Dir="$PRUNDIR/synth_1" IncludeInArchive="true" IsChild="false" AutoIncrementalDir="$PSRCDIR/utils_1/imports/synth_1" AutoRQSDir="$PSRCDIR/utils_1/imports/synth_1" ParallelReportGen="true">
<Strategy Version="1" Minor="2"> <Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2024"> <StratHandle Name="Vivado Synthesis Defaults" Flow="Vivado Synthesis 2024"/>
<Desc>Vivado Synthesis Defaults</Desc>
</StratHandle>
<Step Id="synth_design"/> <Step Id="synth_design"/>
</Strategy> </Strategy>
<GeneratedRun Dir="$PRUNDIR" File="gen_run.xml"/> <GeneratedRun Dir="$PRUNDIR" File="gen_run.xml"/>
@ -380,9 +378,7 @@
</Run> </Run>
<Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7a35ticsg324-1L" ConstrsSet="constrs_1" Description="Default settings for Implementation." AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" Dir="$PRUNDIR/impl_1" SynthRun="synth_1" IncludeInArchive="true" IsChild="false" GenFullBitstream="true" AutoIncrementalDir="$PSRCDIR/utils_1/imports/impl_1" LaunchOptions="-jobs 6 " AutoRQSDir="$PSRCDIR/utils_1/imports/impl_1" ParallelReportGen="true"> <Run Id="impl_1" Type="Ft2:EntireDesign" Part="xc7a35ticsg324-1L" ConstrsSet="constrs_1" Description="Default settings for Implementation." AutoIncrementalCheckpoint="false" WriteIncrSynthDcp="false" State="current" Dir="$PRUNDIR/impl_1" SynthRun="synth_1" IncludeInArchive="true" IsChild="false" GenFullBitstream="true" AutoIncrementalDir="$PSRCDIR/utils_1/imports/impl_1" LaunchOptions="-jobs 6 " AutoRQSDir="$PSRCDIR/utils_1/imports/impl_1" ParallelReportGen="true">
<Strategy Version="1" Minor="2"> <Strategy Version="1" Minor="2">
<StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2024"> <StratHandle Name="Vivado Implementation Defaults" Flow="Vivado Implementation 2024"/>
<Desc>Default settings for Implementation.</Desc>
</StratHandle>
<Step Id="init_design"/> <Step Id="init_design"/>
<Step Id="opt_design"/> <Step Id="opt_design"/>
<Step Id="power_opt_design"/> <Step Id="power_opt_design"/>
@ -391,9 +387,7 @@
<Step Id="phys_opt_design"/> <Step Id="phys_opt_design"/>
<Step Id="route_design"/> <Step Id="route_design"/>
<Step Id="post_route_phys_opt_design"/> <Step Id="post_route_phys_opt_design"/>
<Step Id="write_bitstream"> <Step Id="write_bitstream"/>
<Option Id="BinFile">1</Option>
</Step>
</Strategy> </Strategy>
<GeneratedRun Dir="$PRUNDIR" File="gen_run.xml"/> <GeneratedRun Dir="$PRUNDIR" File="gen_run.xml"/>
<ReportStrategy Name="Vivado Implementation Default Reports" Flow="Vivado Implementation 2024"/> <ReportStrategy Name="Vivado Implementation Default Reports" Flow="Vivado Implementation 2024"/>