CHOCHI - an inexpensive FPGA board with 128K SRAM
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
enso wrote:
Looking at the SRAM128K.v module I noticed the 'OE = 0' line... That is probably not a good thing - it should really not be enabled during writing. I can't remember if the datasheet implied that it doesn't matter as the output goes hi-z.
Quote:
Arlet, regarding your final scope screendump - what is the horizontal unit? How often are the transients occuring?
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
I have to run out and my brain is not really working, but...
At 45MHz each clock is 220ns; the pulses are coming at weird intervals, no?
At 45MHz each clock is 220ns; the pulses are coming at weird intervals, no?
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
enso wrote:
At 45MHz each clock is 220ns; the pulses are coming at weird intervals, no?
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
Yes, I meant 22, not 220. Can you tell how often the pulses come in terms 6502 cycles?
Here is the bootloader loop:
Most of the time the CPU sits in the poll1 loop. I am curious which instruction causes the spike since it's so regular...
I have to fix the bootloader to not use high memory variables. That prevents it from overloading the top of page $FF.
Here is the bootloader loop:
Code: Select all
;--------------------------------------------------------------
; Poll serial port for input. Flash the led while doing so...
poll1: dec 0 ;low digit 0
bne getbyte
poll2: dec 1 ;digit 1
bne getbyte
poll3: dec 2 ;if we get here, counted 64K
lda 2 ;get digit 2
lsr a ;and use bit 2 as flasher
lsr a
lsr a
sta $C000
getbyte: lda UART_STATUS ;Serial port status
and #$40 ;mask data present bit
beq poll1 ;no char to get
lda UART_DATA ;get chr
rts ;
Most of the time the CPU sits in the poll1 loop. I am curious which instruction causes the spike since it's so regular...
I have to fix the bootloader to not use high memory variables. That prevents it from overloading the top of page $FF.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
Arlet, when you get a chance, could you put the clock on the second channel of your scope?
The clock is connected to a pin on the connector. I am away from my workspace, but I am pretty sure it's the third pin from the left on the bottom row of the connector. I'll double-check when I get a chance.
The clock is connected to a pin on the connector. I am away from my workspace, but I am pretty sure it's the third pin from the left on the bottom row of the connector. I'll double-check when I get a chance.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
enso:
I've attached an SRAM Interface module that uses the technique for generating the SRAM control strobes that I described yesterday: ODDR2 registers to generate SRAM chip enable, output enable, and write enable. I've included a synthesizable memory tester in the attached ZIP, in addition to a self-checking functional test bench.
The functional test bench and the synthesizable memory tester have been run to verify the ChoChi_SRAM_IF.v module which I've attached. I was unable to get a DDR2 tri-state control register to join with the IOB OFD used for the the output data register, so I've had to resort to using a 2x clock to enable the data bus drivers (from FPGA to SRAM) only during the period while the data bus is being driven.
The SRAM address and SRAM write data are captured in IOB OFDs on the falling edge of the system clock. This approach minimizes data path skews from the core to the SRAM. I looked at the source for Arlet's core that you provided, and it clearly multiplexes in an asynchronous manner the address bus (AB) and the output data bus (DO). An asynchronous multiplexer can also be found for the the we output.
In your SRAM interface module, you only register the data from the SRAM. The attached SRAM interface module registers the data on the way out and on the way in. The issue will be whether or not the combinatorial path delays in the AB and DO multiplexer signal paths are less than half of the clock period. If so, then the attached SRAM IF will provide deskewed address and data outputs, and retain the single cycle behavior that you would like to have.
I have not yet attached the connectors to the CHOCHI board which you sent me, so I built the SRAM Interface Test module for my M65C02 FPGA test board. (For a few minutes last night, I was frantically turning the office and house upside down trying to locate the CHOCHI board so I could check the speed of the part. I finally found it on the kitchen counter in its shipping container.
) I ran the interface tester on one of my SRAMs, on which I've been running a simple test program for the past few weeks.
Both the CHOCHI SRAM and my SRAMs are 10ns asynchronous devices. I have a 14.7456 MHz oscillator as the reference oscillator, and I use a DCM for internal clock and reset generation. (I've also attached the clock and reset generator module that I used for testing.) I had to run the clock frequency to above 66 MHz before I was able to get the tester function to detect an error. The synthesizable memory tester is performing a walking 1s and walking 0s (16 patterns) test on each memory location in my 32kB SRAM. (I only tested one of the two SRAMs on my board.) I was only able to get an error in the memory pattern when I operated at 66+ MHz and I put both scope leads on the same data line.
If I get a chance later this week, I will try building your CHOCHI code and running it on that card. I may also try and get your code running on my little board. I may also try getting your SRAM128K module to operate with the synthesizable memory tester. The synchronous nature of the test pattern generator will not be a good analog of the AB and DO multiplexer signal paths in your 6502 code. But it will provide an independent assessment of your memory interface, and perhaps help pinpoint the source of the glitches being observed.
Hope the attached code is of some use to you.
I've attached an SRAM Interface module that uses the technique for generating the SRAM control strobes that I described yesterday: ODDR2 registers to generate SRAM chip enable, output enable, and write enable. I've included a synthesizable memory tester in the attached ZIP, in addition to a self-checking functional test bench.
The functional test bench and the synthesizable memory tester have been run to verify the ChoChi_SRAM_IF.v module which I've attached. I was unable to get a DDR2 tri-state control register to join with the IOB OFD used for the the output data register, so I've had to resort to using a 2x clock to enable the data bus drivers (from FPGA to SRAM) only during the period while the data bus is being driven.
The SRAM address and SRAM write data are captured in IOB OFDs on the falling edge of the system clock. This approach minimizes data path skews from the core to the SRAM. I looked at the source for Arlet's core that you provided, and it clearly multiplexes in an asynchronous manner the address bus (AB) and the output data bus (DO). An asynchronous multiplexer can also be found for the the we output.
In your SRAM interface module, you only register the data from the SRAM. The attached SRAM interface module registers the data on the way out and on the way in. The issue will be whether or not the combinatorial path delays in the AB and DO multiplexer signal paths are less than half of the clock period. If so, then the attached SRAM IF will provide deskewed address and data outputs, and retain the single cycle behavior that you would like to have.
I have not yet attached the connectors to the CHOCHI board which you sent me, so I built the SRAM Interface Test module for my M65C02 FPGA test board. (For a few minutes last night, I was frantically turning the office and house upside down trying to locate the CHOCHI board so I could check the speed of the part. I finally found it on the kitchen counter in its shipping container.
Both the CHOCHI SRAM and my SRAMs are 10ns asynchronous devices. I have a 14.7456 MHz oscillator as the reference oscillator, and I use a DCM for internal clock and reset generation. (I've also attached the clock and reset generator module that I used for testing.) I had to run the clock frequency to above 66 MHz before I was able to get the tester function to detect an error. The synthesizable memory tester is performing a walking 1s and walking 0s (16 patterns) test on each memory location in my 32kB SRAM. (I only tested one of the two SRAMs on my board.) I was only able to get an error in the memory pattern when I operated at 66+ MHz and I put both scope leads on the same data line.
If I get a chance later this week, I will try building your CHOCHI code and running it on that card. I may also try and get your code running on my little board. I may also try getting your SRAM128K module to operate with the synthesizable memory tester. The synchronous nature of the test pattern generator will not be a good analog of the AB and DO multiplexer signal paths in your 6502 code. But it will provide an independent assessment of your memory interface, and perhaps help pinpoint the source of the glitches being observed.
Hope the attached code is of some use to you.
Michael A.
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
Michael, I am extremely grateful. I will look at your code when ASAP and will can't wait to see what your investigation reveals. Let me know if you need anything at all.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
Something to keep in mind - the XC3S50 is the faster speed grade 5
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
I'll try to find some time later to measure this. But you can also run a sim, and see if you get the same pulses.
But keep in mind that with combinatorial outputs you can have glitches even if you're not using SRAM. Basically, you can have random data on all your SRAM signals except in the (very small) setup/hold interval around a clock.
But keep in mind that with combinatorial outputs you can have glitches even if you're not using SRAM. Basically, you can have random data on all your SRAM signals except in the (very small) setup/hold interval around a clock.
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
Arlet, the other educational thing to try is to hook your board up and see if it exhibits the same kind of glitches in a dead loop.
As I mentioned before (and you seem to agree) my guess is that we are looking at the normal operation of the core, and there is nothing to be alarmed about.
Registering the control signals would probably incur an extra cycle delay, so there we are.
As I mentioned before (and you seem to agree) my guess is that we are looking at the normal operation of the core, and there is nothing to be alarmed about.
Registering the control signals would probably incur an extra cycle delay, so there we are.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
If you add a register on the output signals, but remove the register on the input, the cycle count stays the same, but you don't risk writing to the RAM.
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
cc65 support files are now available. I just posted the files in the 'Programming' topic viewtopic.php?f=2&t=2728and the CHOCHI website http://apple2.x10.mx/CHOCHI/.
The zipfile includes everything necessary (other than cc65 itself) to start compiling C code, including an example that blinks an LED.
The zipfile includes everything necessary (other than cc65 itself) to start compiling C code, including an example that blinks an LED.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
is this still active/available?
I got a bounce from enso's email address on his web page.
I got a bounce from enso's email address on his web page.
- BigDumbDinosaur
- Posts: 9426
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: CHOCHI - an inexpensive FPGA board with 128K SRAM
jazz wrote:
is this still active/available?
I got a bounce from enso's email address on his web page.
I got a bounce from enso's email address on his web page.
x86? We ain't got no x86. We don't NEED no stinking x86!