Shop OBEX P1 Docs P2 Docs Learn Events
Memory drivers for P2 - PSRAM/SRAM/HyperRAM (was HyperRAM driver for P2) - Page 19 — Parallax Forums

Memory drivers for P2 - PSRAM/SRAM/HyperRAM (was HyperRAM driver for P2)

1161719212237

Comments

  • roglohrogloh Posts: 5,829
    edited 2020-09-18 04:31
    @dgately They are all valid test options, so you could test both your Flash and HyperRAM at both the sysclk/1 and sysclk/2 read speeds using the full delay range and check that the default driver delay (in parentheses) will work with 100% success over the frequency range from 50-350MHz. The unregistered clock option is really just experimental to see if the range is extended/reduced, the (current) default is registered unless overridden at startup.

    So good test options would be:

    50-350MHz
    1, 0, 0, 0 - for fast sysclk/1 + RAM (with a registered clk pin)

    50-350MHz
    1, 0, 0, 1 - for fast sysclk/1 + Flash (with a registered clk pin)

    50-350MHz
    0, 0, 0, 0 - for sysclk/2 + RAM (with a registered clk pin)

    50-350MHz
    0, 0, 0, 1 - for sysclk/2 + Flash (with a registered clk pin)

    You could then do the same with an unregistered clock pin if you felt like it to see if choosing that improves/degrades the range and the overlaps. From memory I think it typically helps increase overlap slightly but reduces the top end range.

  • @evanh , if you get a chance and the inclination, would you like to run this test on your HyperRAM/HyperFlash setup too, to see if the default delay values work out for your HW? If the HyperFlash test is selected it will erase the last sector in case you have some valid data in there that you needed to keep.
  • roglohrogloh Posts: 5,829
    edited 2020-09-18 07:40
    Here's a simple demo binary to show a COG drawing dynamically into a HyperRAM frame buffer while the video COG reads it out at the same time, and changing the display resolutions / P2 frequencies on the fly with the HyperRAM driver adjusting it's timing automatically to match the correct delay.

    Cycles through VGA, SVGA, XGA, SXGA, FULLHD video in the different colour depths (except 16 & 24bpp to avoid overloading with the higher resolutions - I should try to add it back for the lower resolutions that support that).

    You need to fit a HyperRAM expansion module on pins 32-47 and your VGA board on pin 0-7 of the P2-EVAL.

    This demo will operate the P2 at clocks ranging from 195MHz - 297MHz.
  • evanhevanh Posts: 16,014
    edited 2020-09-18 07:40
    Ah, your randomiser isn't correct. You're overwriting the state variable with the generator's output. It'll be random still but likely have reduced state space and probably not distributed evenly either. Here's the fixed version:
    PUB randomizeBuf(seed) : r | i
        repeat i from 0 to BUFSIZE-1
            long[@writebuffer][i]:=??seed
        
        return seed
    
    It's similar to how "z := x++" updates x as well as z.

  • Hmm, ok well it looked random enough when I saw the numbers, I guess it skips some values. I have just posted a new binary with your fix.
  • evanhevanh Posts: 16,014
    A quick turnaround there. :)
  • :smile: Yeah it was only one line and I saw your post popup out of the corner of my eye pretty much right away.
  • evanhevanh Posts: 16,014
    Oh, suck, I need your Hyper driver code to compile this.
  • roglohrogloh Posts: 5,829
    edited 2020-09-18 08:16
    No just use "loadp2 -t ... " etc with the latest binary above. It has your fix.
  • evanhevanh Posts: 16,014
    edited 2020-09-18 08:28
    Yeah, did that but the results suggest you're doing two passes with registered/unregistered pins for each line. Sysclock/1 shouldn't be able to ever produce 100% score for two compensations.

    EDIT: Actually, it looks like the code uses the same timing parameters for both the read and write passes for the same test. That's probably not ideal for separating read limitations from write limitations.

  • roglohrogloh Posts: 5,829
    edited 2020-09-18 08:34
    My 4 bit "delay" value's LSB is actually the data pins being registered or not. The actual clock delay cycles in the waitx code ultimately uses the value without the LSB (ie. delay>>1, shift operation not shown) So you are sort of correct about the table values. Don't worry that the number presented doesn't match your own interpretation of delay.
                                wypin   clks, clkpin            'setup number of transfer clocks
                                wrpin   regdatabus, datapins    'setup data bus inputs as registered or not
                                waitx   delay                   'tuning delay for input data reading
                                xinit   xrecv, #0               'start data transfer and then jump to setup code
    
  • evanhevanh Posts: 16,014
    Ha! I thought I was stabbing a little wildly but must say I'm a little chuffed now. :)
  • roglohrogloh Posts: 5,829
    edited 2020-09-18 08:41
    evanh wrote: »
    EDIT: Actually, it looks like the code uses the same timing parameters for both the read and write passes for the same test. That's probably not ideal for separating read limitations from write limitations.
    Yeah I guess in theory I should do the RAM write just once like I do with flash. Then read with different delays. Write doesn't use the clock delay, but it could vary slightly with the registered/unregistered bus settings. It is always done at sysclk/2 however and the clock is centered in the middle of the data (I've checked this one on the scope - so it should remain reliable).

    Update: scratch that. Only reads ever change registered/unregistered data pins and they restore the setting at the end of the read. Writes keep this setting static.
  • evanhevanh Posts: 16,014
    edited 2020-09-18 08:47
    rogloh wrote: »
    It is always done at sysclk/2 however and the clock is centered in the middle of the data (I've checked this one on the scope - so it should remain reliable).

    Update: scratch that. Only reads ever change registered/unregistered data pins and they restore the setting at the end of the read. Writes keep this setting static.
    Yeah, that's reliable. Writes at sysclock/2 is a very stable config. They don't have that stretching effect on the latency that the reads have. Attenuation is the only limit for writes.

  • roglohrogloh Posts: 5,829
    edited 2020-09-18 08:56
    Somewhat interested to know how fast your HyperFlash can read out and whether the automatic clock delay breakpoints I have put in work out (at least for room temp). @dgately 's RAM results seemed good. My own flash seems to still read back ok at 350MHz with the sysclk/1 rate. It'll probably go higher but I don't want to test that.
    HyperRAM/HyperFlash memory read delay test over frequency, ESC exits
    Enter the base pin number for your HyperRAM/HyperFlash module (0,16,32) : 32
    Enter a starting frequency to test in MHz (50-350) : [50] 50
    Enter the ending frequency to test in MHz (50-350) : [350] 350
    Enter 1 for fast sysclk/1 read transfers, or 0 for sysclk/2 : [0] 1
    Enter 1 for unregistered clock pins, or 0 for registered pin : [0] 0
    Enter 1 to use the automatic delay value only, or 0 to test over the delay range : [0] 0
    Enter 1 to test HyperFLASH, or 0 for HyperRAM (WARNING test erases last sector of HyperFlash!) : [0] 1
    Driver started, bus = 0
    Erasing last sector
    Programming last sector with random data
    Successful HyperFlash write
    Testing P2 from 50000000 - 350000000 Hz, driver config flags = $80000000
    
    				Successful random transfer percentages 
    Frequency      Delay	3	4	5	6	7	8	9	10	11	12
    50000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    51000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    52000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    53000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    54000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    55000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    56000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    57000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    58000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    59000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    60000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    61000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    62000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    63000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    64000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    65000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    66000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    67000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    68000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    69000000	 (5) 	0	0	100	100	0	0	0	0	0	0
    70000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    71000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    72000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    73000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    74000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    75000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    76000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    77000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    78000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    79000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    80000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    81000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    82000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    83000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    84000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    85000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    86000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    87000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    88000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    89000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    90000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    91000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    92000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    93000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    94000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    95000000	 (6) 	0	0	100	100	0	0	0	0	0	0
    96000000	 (6) 	0	0	1	100	0	0	0	0	0	0
    97000000	 (6) 	0	0	0	100	0	0	0	0	0	0
    98000000	 (6) 	0	0	0	100	0	0	0	0	0	0
    99000000	 (6) 	0	0	0	100	0	0	0	0	0	0
    100000000	 (6) 	0	0	0	100	0	0	0	0	0	0
    101000000	 (6) 	0	0	0	100	0	0	0	0	0	0
    102000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    103000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    104000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    105000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    106000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    107000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    108000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    109000000	 (6) 	0	0	0	100	100	0	0	0	0	0
    110000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    111000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    112000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    113000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    114000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    115000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    116000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    117000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    118000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    119000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    120000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    121000000	 (7) 	0	0	0	100	100	0	0	0	0	0
    122000000	 (7) 	0	0	0	16	100	0	0	0	0	0
    123000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    124000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    125000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    126000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    127000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    128000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    129000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    130000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    131000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    132000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    133000000	 (7) 	0	0	0	0	100	0	0	0	0	0
    134000000	 (7) 	0	0	0	0	100	54	0	0	0	0
    135000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    136000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    137000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    138000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    139000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    140000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    141000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    142000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    143000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    144000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    145000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    146000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    147000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    148000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    149000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    150000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    151000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    152000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    153000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    154000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    155000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    156000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    157000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    158000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    159000000	 (7) 	0	0	0	0	100	100	0	0	0	0
    160000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    161000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    162000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    163000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    164000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    165000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    166000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    167000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    168000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    169000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    170000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    171000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    172000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    173000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    174000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    175000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    176000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    177000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    178000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    179000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    180000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    181000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    182000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    183000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    184000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    185000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    186000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    187000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    188000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    189000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    190000000	 (8) 	0	0	0	0	100	100	0	0	0	0
    191000000	 (8) 	0	0	0	0	84	100	0	0	0	0
    192000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    193000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    194000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    195000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    196000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    197000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    198000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    199000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    200000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    201000000	 (8) 	0	0	0	0	0	100	0	0	0	0
    202000000	 (8) 	0	0	0	0	0	100	1	0	0	0
    203000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    204000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    205000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    206000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    207000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    208000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    209000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    210000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    211000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    212000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    213000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    214000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    215000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    216000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    217000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    218000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    219000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    220000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    221000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    222000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    223000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    224000000	 (8) 	0	0	0	0	0	100	100	0	0	0
    225000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    226000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    227000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    228000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    229000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    230000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    231000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    232000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    233000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    234000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    235000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    236000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    237000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    238000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    239000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    240000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    241000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    242000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    243000000	 (9) 	0	0	0	0	0	100	100	0	0	0
    244000000	 (9) 	0	0	0	0	0	67	100	0	0	0
    245000000	 (9) 	0	0	0	0	0	5	100	0	0	0
    246000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    247000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    248000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    249000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    250000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    251000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    252000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    253000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    254000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    255000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    256000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    257000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    258000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    259000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    260000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    261000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    262000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    263000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    264000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    265000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    266000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    267000000	 (9) 	0	0	0	0	0	0	100	0	0	0
    268000000	 (9) 	0	0	0	0	0	0	100	16	0	0
    269000000	 (9) 	0	0	0	0	0	0	100	91	0	0
    270000000	 (9) 	0	0	0	0	0	0	100	100	0	0
    271000000	 (9) 	0	0	0	0	0	0	100	100	0	0
    272000000	 (9) 	0	0	0	0	0	0	100	100	0	0
    273000000	 (9) 	0	0	0	0	0	0	100	100	0	0
    274000000	 (9) 	0	0	0	0	0	0	100	100	0	0
    275000000	 (9) 	0	0	0	0	0	0	100	100	0	0
    276000000	 (9) 	0	0	0	0	0	0	100	100	0	0
    277000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    278000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    279000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    280000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    281000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    282000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    283000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    284000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    285000000	 (10) 	0	0	0	0	0	0	100	100	0	0
    286000000	 (10) 	0	0	0	0	0	0	94	100	0	0
    287000000	 (10) 	0	0	0	0	0	0	4	100	0	0
    288000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    289000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    290000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    291000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    292000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    293000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    294000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    295000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    296000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    297000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    298000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    299000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    300000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    301000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    302000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    303000000	 (10) 	0	0	0	0	0	0	0	100	0	0
    304000000	 (10) 	0	0	0	0	0	0	0	100	2	0
    305000000	 (10) 	0	0	0	0	0	0	0	100	93	0
    306000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    307000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    308000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    309000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    310000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    311000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    312000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    313000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    314000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    315000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    316000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    317000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    318000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    319000000	 (10) 	0	0	0	0	0	0	0	100	100	0
    320000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    321000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    322000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    323000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    324000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    325000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    326000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    327000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    328000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    329000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    330000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    331000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    332000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    333000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    334000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    335000000	 (11) 	0	0	0	0	0	0	0	100	100	0
    336000000	 (11) 	0	0	0	0	0	0	0	95	100	0
    337000000	 (11) 	0	0	0	0	0	0	0	15	100	0
    338000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    339000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    340000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    341000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    342000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    343000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    344000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    345000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    346000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    347000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    348000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    349000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    350000000	 (11) 	0	0	0	0	0	0	0	0	100	0
    
  • evanhevanh Posts: 16,014
    Here's a couple of runs with same options but with different hardware. One is my RevB globtop with the HR board that has a 22 pF capacitor added on the HR clock pin of the accessory header. The other is the RevB finished package without any capacitor added.
  • evanhevanh Posts: 16,014
    Here's a HyperFlash run. Notably it has two compensations hitting 100% at 350 MHz. I put this down to me using P16 as the base pin.
  • roglohrogloh Posts: 5,829
    edited 2020-09-18 09:17
    Thanks for that. Yeah your 22pF mod has shifted things about, you would need a tweak to the timing profile if you wanted to use that HW. The setup without the cap looks okay except around 233MHz crossing (that seems to be a problematic region in general).

    Your HyperFlash run looks great too.
  • roglohrogloh Posts: 5,829
    edited 2020-09-18 09:33
    Just realised something cool about my driver. Because I have up to 16 banks per bus, and it is unlikely that we will have over 8 physical devices on the same bus, for systems with less than 128MB fitted I can actually use a second bank to map to the same memory as the normal bank does, but give it different delays (delays are stored on a per bank basis). This means a background process in theory could be reading/writing to a spare area of HyperRAM, testing out which of the two neighbouring delay values is better to use. This can happen without affecting the current setting on the normally read bank. Once you know the best new value to use you can change the normal bank too. This might let us track changes with temperature perhaps...
  • evanhevanh Posts: 16,014
    Good. That's gonna be the only way to manage the accessory boards at sysclock/1 me thinks.
  • Yes if the temperature varies we already know things can change. I'm sort of happy that with three different boards there isn't a huge amount of timing difference seen so far for room temp operation, though for other non P2-EVAL setups and other HyperRAM devices it could easily vary more of course. Probably we can hope to avoid the frequency regions where the timing overlaps. HyperFlash seems like it has a lot more overlap in general.
  • rogloh wrote: »
    @dgately They are all valid test options, so you could test both your Flash and HyperRAM at both the sysclk/1 and sysclk/2 read speeds using the full delay range and check that the default driver delay (in parentheses) will work with 100% success over the frequency range from 50-350MHz. The unregistered clock option is really just experimental to see if the range is extended/reduced, the (current) default is registered unless overridden at startup.

    So good test options would be...
    Attached:Zipped-file of tests for registered and unregistered clock pins... I think, nothing unexpected here!



  • Thanks dgately. Looks to me like the registered clock setting is the way to go, so keeping that as the default is what I will do. It increases the top end range too to cover the 297MHz operation.

    In your setup with registered clocks, 88-95MHz, 230-235MHz and 275-280MHz are probably good frequency ranges to try to avoid if you can for fastest sysclk/1 HyperRAM performance (at least at the temperature you tested), or you could tweak the timing profile further to improve it in your setup. HyperFlash looks great over the full range at sysclk/1 speeds.

    It will be easy to tweak, the attached driver code snippet below shows what I did to setup the default profile and you can still get to create your own and apply them after driver startup. I may end up creating another variant for sysclk/2 vs sysclk/1 operation too.

    In the future I originally thought it may be possible to interpolate between different profiles based on a measured temperature, though this is problematic because it relies on some extra HW ability to monitor temperature and have some background thread/COG doing it (or periodically delay requests if the driver does it - not ideal). An alternative would be something that periodically reads/writes into a small reserved portion of RAM that has been mapped using a secondary bank and this operation tracks the read errors with both neighbouring delay values and finds the best delay automatically for the given operating frequency (no temp sensor needed). All TBD but I think for now we keep things as is. The unstable frequency ranges are thankfully still pretty small and could be possible to avoid anyway.

    'Default delay profiles used for HyperFlash and HyperRAM on P2-EVAL HyperRAM breakout board 
    'operating at room temp. This can be tweaked or others added for different temperatures.
    'These delay profiles can be assigned to each configured device at address mapping time.
    'The actual operating input delay can also be adjusted on the fly per bank if the variation 
    'of delay with temperature is already determined and the temperature is known/measurable.
    
    HyperRamDelays          long 6,92_000000,135_000000,188_000000,234_000000,280_000000,0
    HyperRamDelaysUnreg     long 6,88_000000,120_000000,180_000000,225_000000,270_000000,0
    
    HyperFlashDelays        long 5,70_000000,110_000000,160_000000,225_000000,277_000000,320_000000,0
    HyperFlashDelaysUnreg   long 5,70_000000,105_000000,150_000000,210_000000,260_000000,315_000000,0
    
    'The profile format begins with the initial delay value, followed by frequencies at which the
    'delay is sequentially increased until either it falls below the next frequency, or the list 
    'terminates with a zero.  Frequencies must be stored in increasing order.
    
    ' e.g. using HyperRam data above for unregistered clock option
    '   if            0 <= freq <  88000000 Hz, the delay compensation value is 6,
    '   if    880000000 <= freq < 120000000 Hz, the delay compensation value is 7,
    '   if    120000000 <= freq < 180000000 Hz, the delay compensation value is 8,
    '                   ...etc...
    '   if    270000000 <= freq               , the delay compensation value is 11 
    '
    
  • evanhevanh Posts: 16,014
    edited 2020-09-19 21:17
    rogloh wrote: »
    Thanks for that. Yeah your 22pF mod has shifted things about, you would need a tweak to the timing profile if you wanted to use that HW.
    Huh, looking back at my old log files I see I started investigating using a 10 pF cap in place of the 22 pF. It looked like it was okay. I should do some more testing of that ...

    EDIT: Oh, I also discovered that P32 as the base pin on the RevB Eval Board sucks. Even with the 22 pF cap, writes at sysclock/1 still can fail at certain bands, namely around 120 MHz and 240 MHz. Best not to use P32 unless you have the RevC Eval Board.

  • evanhevanh Posts: 16,014
    edited 2020-09-19 21:43
    Here's the sysclock/1 burst write runs for P0, P16 and P32 basepin without any clock capacitor. Compensation 4 shows a nice curve of worse and better frequencies. Lower is better. P0 and P16 are pretty similar. P32 is much worse over all.

    I've included the run for P32 with 22 pF clock cap also. At 256 MHz it has a single bit error. If I remember correctly, all attempts of that config had at least one error around there.

    PS: I think the B2 naming means I used the Eval Board with the finished packaged chip for these tests. For most prior testing I used the Eval Board with the globtop chip.
  • roglohrogloh Posts: 5,829
    edited 2020-09-20 00:33
    Ok, the wiring to P32 may be less than ideal for sysclk/1 writes which I don't support in the driver at this point. I think it mostly works okay for sysclk/2 writes and sysclk/1 reads at least.

    Supporting sysclk/1 writes in the future will need to somehow free some LUTRAM space to fit it in. Recently I shuffled things about and I think I now have 7 LUTRAM longs free, and 2 COGRAM longs free so hopefully that may help.

    It may still need a sysclk/2 transfer portion at the start for the address phase so I can still share it with my existing instruction sequence and any sysclk/1 operation has to be disabled for fills because I need the rep loop below to fill HyperRAM with arbitrary bytes/word/long patterns and this takes 2 clocks per xcont transferring a byte. This means that any future sysclk/1 support could only help the burst writes and copies in my driver, not individual writes or fills.
                                rep     #1, pb                  'repeat transfers if filling
                                xcont   xsend, hubdata          'stream the immediate/hub fifo data
    
  • evanhevanh Posts: 16,014
    I haven't tried a lot of sysclock/2 testing. I should see how bullet proof it really is at burst writes. On that note, I just realised the new mini toaster oven I got for de-soldering is pretty good for cheaply raising the ambient temperature when testing all this gear.

  • LOL, all the interesting uses of a toaster oven these days.

    Maybe for cooling you could put the thing in a fridge to cool it down to a few degrees C and have some USB wires coming out for logging the result and current temperature if you have a thermocouple/sensor attached.
  • evanhevanh Posts: 16,014
    edited 2020-09-20 01:10
    Ouch, my glob-top is failing even more. I can't use P0 as the base pin on it any longer. :( EDIT: It's probably the first time I've tried to use P0 for this since I roasted that board. It could be a de-soldered pin in that group.

  • evanhevanh Posts: 16,014
    edited 2020-09-20 01:38
    rogloh wrote: »
    Maybe for cooling you could put the thing in a fridge to cool it down to a few degrees C and have some USB wires coming out for logging the result and current temperature if you have a thermocouple/sensor attached.
    I have used chiller ice packs to go as low is -10 °C. Of course I have to be organised to pack and time them right for best outcomes. For example, to go below -5 °C I have to also pre-chill the board in the freezer before transporting everything to the project room. I have a small soft chiller bag to pack them in tight.

Sign In or Register to comment.