6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 4:39 am

All times are UTC




Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
Author Message
PostPosted: Sun Sep 29, 2013 4:24 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
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.

That's not a problem. WE takes priority.

Quote:
Arlet, regarding your final scope screendump - what is the horizontal unit? How often are the transients occuring?


Horizontal unit is shown in the display -- 100 ns/division.


Top
 Profile  
Reply with quote  
PostPosted: Sun Sep 29, 2013 4:44 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
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?

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Sun Sep 29, 2013 4:48 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
enso wrote:
At 45MHz each clock is 220ns; the pulses are coming at weird intervals, no?


1000/45 = 22.22 ns. Looks like it is high for about 1 clock period, and then discharges through the pull down resistor.


Top
 Profile  
Reply with quote  
PostPosted: Sun Sep 29, 2013 9:30 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
Yes, I meant 22, not 220. Can you tell how often the pulses come in terms 6502 cycles?

Here is the bootloader loop:
Code:
;--------------------------------------------------------------
; 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


Top
 Profile  
Reply with quote  
PostPosted: Sun Sep 29, 2013 11:16 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
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.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Sun Sep 29, 2013 11:46 pm 
Offline
User avatar

Joined: Mon Apr 23, 2012 12:28 am
Posts: 760
Location: Huntsville, AL
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. :oops: ) 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.

Attachment:
File comment: Synchronous interface for asynchronous SRAMs.
SRAM_IF.zip [14.14 KiB]
Downloaded 131 times

_________________
Michael A.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 30, 2013 12:20 am 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 30, 2013 12:25 am 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 30, 2013 4:49 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 30, 2013 4:40 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
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.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 30, 2013 4:53 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat Oct 12, 2013 11:44 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
cc65 support files are now available. I just posted the files in the 'Programming' topic http://forum.6502.org/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.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 12, 2017 3:22 pm 
Offline

Joined: Tue Apr 11, 2017 1:50 pm
Posts: 7
Location: UK
is this still active/available?
I got a bounce from enso's email address on his web page.


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 12, 2017 4:48 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
jazz wrote:
is this still active/available?
I got a bounce from enso's email address on his web page.

Good question. Enso hasn't visited the forum since June last year.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: