Skip to content

Commit

Permalink
Merge pull request #582 from slaclab/epix-dev
Browse files Browse the repository at this point in the history
Updates for epix development (SACI, ssi_printf, AnalogDevices/ad9249)
  • Loading branch information
ruck314 authored Jan 11, 2020
2 parents fcc76a0 + 3d9e402 commit 363687b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
14 changes: 10 additions & 4 deletions devices/AnalogDevices/ad9249/7Series/rtl/Ad9249ReadoutGroup.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ architecture rtl of Ad9249ReadoutGroup is
readoutDebug1 : slv16Array(NUM_CHANNELS_G-1 downto 0);
lockedCountRst : sl;
invert : sl;
curDelayFrame : slv(4 downto 0);
curDelayData : slv5Array(NUM_CHANNELS_G-1 downto 0);
end record;

constant AXIL_REG_INIT_C : AxilRegType := (
Expand All @@ -90,7 +92,9 @@ architecture rtl of Ad9249ReadoutGroup is
readoutDebug0 => (others => (others => '0')),
readoutDebug1 => (others => (others => '0')),
lockedCountRst => '0',
invert => '0'
invert => '0',
curDelayFrame => (others => '0'),
curDelayData => (others => (others => '0'))
);

signal lockedSync : sl;
Expand Down Expand Up @@ -212,7 +216,9 @@ begin

v.dataDelaySet := (others => '0');
v.frameDelaySet := '0';
v.axilReadSlave.rdata := (others => '0');

v.curDelayFrame := curDelayFrame;
v.curDelayData := curDelayData;

-- Store last two samples read from ADC
if (debugDataValid = '1' and axilR.freezeDebug = '0') then
Expand All @@ -235,9 +241,9 @@ begin

-- Override read from r.delay and use curDealy output from delay primative instead
for i in 0 to NUM_CHANNELS_G-1 loop
axiSlaveRegisterR(axilEp, X"00"+toSlv((i*4), 8), 0, curDelayData(i));
axiSlaveRegisterR(axilEp, X"00"+toSlv((i*4), 8), 0, axilR.curDelayData(i));
end loop;
axiSlaveRegisterR(axilEp, X"20", 0, curDelayFrame);
axiSlaveRegisterR(axilEp, X"20", 0, axilR.curDelayFrame);


-- Debug output to see how many times the shift has needed a relock
Expand Down
2 changes: 1 addition & 1 deletion protocols/saci/rtl/SaciMaster2.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ architecture rtl of SaciMaster2 is
shiftCount : slv(5 downto 0);

--Saci clk gen
clkCount : slv(SACI_CLK_COUNTER_SIZE_C-1 downto 0);
clkCount : slv(SACI_CLK_COUNTER_SIZE_C downto 0);
saciClkRising : sl;
saciClkFalling : sl;

Expand Down
7 changes: 6 additions & 1 deletion xilinx/general/sdk/common/ssi_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ void ssi_putc ( void* p, char c) {

// Dual port ram buffer if enabled
if ( pp->buffSize > 0 ) {
Xil_Out8(pp->buffBase+4+pp->buffPtr, c);
//Xil_Out8(pp->buffBase+4+pp->buffPtr, c);
if (pp->buffPtr%4 == 0)
pp->buffWord = c;
else
pp->buffWord |= (c << (pp->buffPtr%4)*8);
Xil_Out32(pp->buffBase+4+(pp->buffPtr/4)*4, pp->buffWord);

// Adjust pointer
pp->buffPtr++;
Expand Down
1 change: 1 addition & 0 deletions xilinx/general/sdk/common/ssi_printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct ssi_printf_type {
uint16_t buffSize;
uint16_t buffPtr;
uint16_t buffTot;
uint32_t buffWord;
};

void ssi_putc ( void* p, const char c);
Expand Down

0 comments on commit 363687b

Please sign in to comment.