Quantcast

Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: busting 32x performance myths

  1. #1
    Sports Talker
    Join Date
    Sep 2013
    Posts
    39
    Rep Power
    0

    Default busting 32x performance myths


    The test code is based on variations of this loop. Does four 32-bit words at a time, has some overhead but not too much. (Note that the index is scaled so +1 is the next 32-bit word.) When all memory accesses are from the cache this takes 11 cycles per iteration.
    Code:
    st02:
            mov [r1].d,r2
            mov [r1+1].d,r2
            mov [r1+2].d,r2
            mov [r1+3].d,r2
            add 16,r1
            cmpeq 1,r0
            bfs st02
            add -1,r0
    Sparse tests only access one 32-bit word every 16 bytes.

    Conclusions:
    Accessing SDRAM is always a 12-cycle burst = true
    writes to VRAM are 5 cycles per word (after the FIFO is filled)
    cartridge ROM is horrendously slow at 8 cycles per word (Say it ain't so!)
    reading from ROM in the cached region $2000000 also causes a "burst" but with no timing advantage
    sequential writes to SDRAM are nice and fast (did not think to test random writes)

    Here is the result from Fusion, which does not emulate all of this timing nuance

    Edit:
    While I'm at it, here is Saturn for comparison at 26.8MHz (tested the low work RAM in place of cartridge ROM)

    Looks like an SDRAM burst read is 6 cycles, VDP2 ram is 2-3 cycles per word, and loRAM is 7?
    Last edited by bakemono; 05-26-2019 at 10:37 PM.

  2. #2
    Outrunner Eep386's Avatar
    Join Date
    Sep 2014
    Location
    Not far from Sacramento
    Posts
    525
    Rep Power
    17

    Default

    One conclusion I can take away from this, is when programming for the 32X *always* try to buffer your stuff in RAM, avoid thrashing the ROM/cartridge space.
    Also Kega Fusion's 32X timing needs some work. :P

  3. #3
    Raging in the Streets Blades's Avatar
    Join Date
    Dec 2006
    Posts
    3,223
    Rep Power
    79

    Default

    Very neat, thanks for sharing.

  4. #4
    Comrade as in friend. Master of Shinobi ComradeOj's Avatar
    Join Date
    Dec 2012
    Location
    New Mexico, USA
    Age
    24
    Posts
    1,333
    Rep Power
    56

    Default

    So, this is a bit off topic, but could I ask about your 32x programming environment and resources? What sort of 32x tools are you using, and what resources are you using to learn how the hardware works? I have some pages with good info saved, but I'm wondering if there is something else out there. I'm also interested in how your put together saturn disc images, since that's been a hurdle for me working with the SEGA CD. I'm assuming you're writing in ASM rather than C based on your sample code. This is how I like to do things too.

    I've done a fair amount of Genesis stuff and am pretty comfortable with the hardware, but have had a hard time breaking in to 32x. I had a SH2/68K assembly compiler set up, but never really got the hardware to do much. I would really like to get playing with the 32x some day.

    Thanks for the post, I look forward to more 32x stuff if you do so in the future.
    Modded consoles:
    Master System (v7040) with s-video & direct AV out
    Model 1 with 10mhz overclock & halt switches
    Model 1 with 10mhz 68010
    Model 2 VA2.3 with unfiltered Mega Amp, & s-video
    Model 3 VA1 with compatibility fixes & s-video
    32X with s-video
    Visit my web site at www.mode5.net
    Or my collection of homebrew Genesis games, programs, and music on SEGA-16!

  5. #5
    Sports Talker
    Join Date
    Sep 2013
    Posts
    39
    Rep Power
    0

    Default

    This is the documentation that I know about:
    SH2 programmer's manual: https://antime.kapsi.fi/sega/files/h12p0.pdf
    DevSter's Guide: http://devster.monkeeh.com/sega/32xguide1.txt
    32x tech: http://novedicus.akawah.net/dir/32x_tech_doc/

    Somewhere there was also a PDF version of one of the manuals seen at that last link. Overall there are still some gaps or things that are not adequately explained, at least for me.

    I actually have never made a Saturn disc image. I just make binaries and use Saturn USB to run those.

    As for dev tools, I am using something different than what anyone else uses... that being the NOWUT cross compiler that I created. So it's not C, but does have inline Asm. In the past I also made a barebones SH2 assembler ("SUPERAS") that used the normal syntax. These can be found on my site http://www.hyakushiki.net/anachro.htm

  6. #6
    Raging in the Streets Sik's Avatar
    Join Date
    Jan 2011
    Posts
    3,353
    Rep Power
    63

    Default

    Are ROM accesses measured with or without the 68000 constatntly accessing ROM? Because I know that when the 68000 is hogging the cartridge (e.g. running off it) the situation should be a lot worse.

  7. #7
    WCPO Agent
    Join Date
    Sep 2012
    Posts
    999
    Rep Power
    26

    Default

    On the Saturn side, can you measure VDP1 VRAM performance?
    I expect it to be the same as VDP2, but just in case....

  8. #8
    For great justice! Outrunner Tor Landeel's Avatar
    Join Date
    Jan 2011
    Age
    38
    Posts
    554
    Rep Power
    17

    Default

    This is great info, thanks for sharing
    Last edited by Tor Landeel; 05-27-2019 at 11:27 AM.
    ***** トル・ランディール ******
    Cadash Arcade Colors hack:
    https://www.romhacking.net/hacks/3905/
    Out Run Arcade Colors hack:
    https://www.romhacking.net/hacks/3940/
    *****************************

  9. #9
    Sports Talker
    Join Date
    Sep 2013
    Posts
    39
    Rep Power
    0

    Default

    Are ROM accesses measured with or without the 68000 constatntly accessing ROM? Because I know that when the 68000 is hogging the cartridge (e.g. running off it) the situation should be a lot worse.
    That was with the 68K running from RAM and not accessing the cartridge at all.
    On the Saturn side, can you measure VDP1 VRAM performance?
    For VDP1 I only got 8400KB/sec. That was with a short command table that set coordinates origin/clipping but didn't draw anything.

    One mysterious thing about Saturn is that I tried toggling between 'E's and 'F's in the memory pattern register on VDP2 and it seemed to make no difference to writing or reading speed. Reading VDP2 memory BTW got only 2400KB/sec.

  10. #10
    Raging in the Streets Sik's Avatar
    Join Date
    Jan 2011
    Posts
    3,353
    Rep Power
    63

    Default

    Quote Originally Posted by bakemono View Post
    That was with the 68K running from RAM and not accessing the cartridge at all.
    Now add a test for when 68000 is running from ROM :​P

    EDIT: I mean have tests for both when 68000 runs off RAM (as it is now) and when it runs off ROM.

  11. #11
    Outrunner Stef's Avatar
    Join Date
    Aug 2011
    Location
    France
    Posts
    614
    Rep Power
    27

    Default

    Would be nice to have the (32X) rom to play with

  12. #12
    Mastering your Systems Shining Hero TmEE's Avatar
    Join Date
    Oct 2007
    Location
    Estonia, Rapla City
    Age
    29
    Posts
    10,088
    Rep Power
    109

    Default

    This is awesome ~
    Death To MP3, :3
    Mida sa loed ? Nagunii aru ei saa "Gnirts test is a shit" New and growing website of total jawusumness !
    If any of my images in my posts no longer work you can find them in "FileDen Dump" on my site ^

  13. #13
    Sports Talker
    Join Date
    Sep 2013
    Posts
    39
    Rep Power
    0

    Default

    Quote Originally Posted by Stef View Post
    Would be nice to have the (32X) rom to play with
    http://www.hyakushiki.net/misc/32xspd.32x
    edit: BTW, this counts 30 vblanks and assumes one half second has gone by, so it will give different numbers on PAL
    Now add a test for when 68000 is running from ROM :​P
    I believe the SH2 has priority but might have to wait for any 68K bus cycle that is already in progress to end first. IIRC the docs said access time could be extended from 8 up to 18 clocks.

    It's too bad that Sega made the timing so loose here. Why not at least put in an option for faster ROM, like the SNES ones that can run at 3.5MHz?

    On the plus side, I guess that any old cheap (E)EPROMs salvaged from whatever could probably be used to build a 32x cart.
    Last edited by bakemono; 05-28-2019 at 07:13 PM.

  14. #14
    Raging in the Streets Sik's Avatar
    Join Date
    Jan 2011
    Posts
    3,353
    Rep Power
    63

    Default

    I mean, the 68000 is not gonna be any faster so there's nothing they could do about the 68000 hogging the cartridge bus against the SH-2 when it got there first. And if it's running code from cartridge area, it's gonna be doing it all the time.

    The loose timings are because the SH-2 could caught it right as it starts, halfway through, etc. (the later in the bus cycle, the less it has to wait)

  15. #15
    WCPO Agent
    Join Date
    Sep 2012
    Posts
    999
    Rep Power
    26

    Default

    May I ask for a Saturn binary that tests both VDP1 and VDP2?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •