TURBORETARD9000,

@jeffcliff @admitsWrongIfProven @sjw I don't have screenshots or shit yet to show but who wants to watch me make an RV32I core in a visual manner
Hoping to get to RV64G + Supervisor eventually

TURBORETARD9000,

@jeffcliff @sjw @p Hey check this shit out, I think it's still in your ballpark

TURBORETARD9000,

@jeffcliff @p @sjw Last stopping point:

TURBORETARD9000,

@jeffcliff @p @sjw @ceo_of_monoeye_dating @ai In theory, a complete RV32I core, and where I left off a few years ago (following along a YouTube video)
In reality, there were a couple bugs that I got stuck on, but hopefully I've bridged that gap in knowledge
But, that's for tomorrow :akko_tired:
Screenshot_2023-11-30_00-59-52.png

TURBORETARD9000,

@ai @ceo_of_monoeye_dating @jeffcliff @p @sjw God damnit I remember why I can't use those lovely RAM pieces
I can't edit the included data...

TURBORETARD9000,

@ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Also I REALLY should organize that, when I start adding more extensions it's going to get messy quick

TURBORETARD9000,

@ai @ceo_of_monoeye_dating @jeffcliff @p @sjw :alexjonesheadache:

> can't use ROM chips without extra work because it'll fuck up using compressed instructions because no non-aligned memory access
> can't use RAM chips because I can't edit the stored data

TURBORETARD9000,

@ai @ceo_of_monoeye_dating @jeffcliff @p @sjw
Known ( :cringingcat: ) good instructions:
ADDI
ADD
SW
LD
AUIPC/LUI
JAL
Gonna try and see if I can whip up some comprehensive tests
Screenshot_2023-11-30_11-28-32.png

TURBORETARD9000,

@ai @ceo_of_monoeye_dating @jeffcliff @p @sjw nvm I think something may be bugged with auipc
Doesn't seem to be actually adding in the PC?
Hmmm
I'm gonna build up some proper tests to make sure I'm not misunderstanding something

jeffcliff,
@jeffcliff@shitposter.club avatar

deleted_by_author

  • Loading...
  • TURBORETARD9000,

    @jeffcliff @ceo_of_monoeye_dating @sjw @ai @p I believe that's write enable, it's being held high rn but I would like to keep it around in case I want to try pipelining

    TURBORETARD9000,

    @jeffcliff @ai @ceo_of_monoeye_dating @p @sjw I think it's an issue in the ALU, I'm supposed to be getting rd = pc + u-imm but I'm only getting rd = u-imm

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw found it, alu a input mux needs the auipc selector

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw AUGH I FORGOT TO SIGN EXTEND THE IMMEDIATES

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I do believe other than fence, ecall, and ebreak, this is a fully functional RV32I hart

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw That being said, I'm gonna have to do a lot of digging into microarchitecture and that sort of meta-logic very soon in order to make those instructions work, and to get a unified memory architecture

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw multiplication extension added and cpu organized
    Screenshot_2023-12-03_15-47-49.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw wait I'm dumb I can eliminate two of those dividers

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I feel now would be a good time to try and figure out how to unify the memory space, because before I can implement CSRs, I'm probably going to want to add atomics
    I want to keep it stupid simple at first though
    ... also I just realized I overwrote the base core...

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw uhhhhh ok yeah this is an interesting hurdle
    Multi cycle architecture never quite clicked with me but I think the amount of stuff in front of my face is distracting me

    ceo_of_monoeye_dating,
    @ceo_of_monoeye_dating@bae.st avatar

    @TURBORETARD9000 @ai @jeffcliff @p @sjw >Multi cycle architecture never quite clicked with me

    Oh, as opposed to processors that use pipelines?

    I think that's kinda normal - I don't think multi-cycle processors are taught in universities.

    TURBORETARD9000,

    @ceo_of_monoeye_dating @ai @jeffcliff @p @sjw well tbh pipelines are more foreign to me, I've never really strayed far from single cycle simulation, but that doesn't work if I want to fetch instructions and data from the same place

    TURBORETARD9000,

    @ceo_of_monoeye_dating @ai @jeffcliff @p @sjw In theory, I have dual port RAM pieces, but it doesn't have unaligned access, and I'd rather have that

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw wait
    Fuck
    If I want to move to rv64 I'm gonna need 64bit data
    Which the unaligned chip doesn't do...
    So I'm going to have to make a new chip anyway

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I just skipped the hurdle lol
    Now have ROM at 0x0, Dual-port RAM at 0x80000000
    Screenshot_2023-12-04_02-11-55.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I can now use the ROM to bootstrap and hold traps and shit
    Once I get there

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Notably: due to java constraints I haven't cared to change yet, only 8MiB each ROM and RAM

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Ughhhhh this is foreign waters to me
    I'm trying to go through the Spike simulator codebase to glean what I can about how CSRs and privileges ISA is supposed to work and it's all blurring together

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I found someone's implementation of cache and wew boy do I have a lot to learn

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Ok so in theory I can use this to get a better idea of how to pipeline this shit, and eventually add things like branch prediction and cache
    It's going to be.... a lot of work but at least now I have a diagram to read
    https://arxiv.org/pdf/2002.03568v1.pdf
    I also found a sim file for a pipelined MIPS CPU with full hazard detection so 🤞

    sjw,
    @sjw@bae.st avatar
    TURBORETARD9000,

    @sjw @ai @ceo_of_monoeye_dating @jeffcliff @p tfw the only architectures I've put my time into were x86 and Risc-V

    TURBORETARD9000,

    @sjw @ai @ceo_of_monoeye_dating @jeffcliff @p holy shit interrupts
    I need them asap
    I thought there was something missing

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Damnit I need part of the privileged ISA anyway
    Ok back to figuring out CSRs and pipelining and IO

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Following these videos, it's a bit confusing because he's using MIPS but it's kinda piecing itself together
    kinda

    TURBORETARD9000,
    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Notably I still haven't handled branches and jumps and hazard detection or even basic testing yet

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I wonder if I have enough information in front of me here to piece together something from verilog files
    Might help me make sense of whatever the fuck I'm staring at

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw woahhhh where'd it all goooooooo
    Things are getting INTERESTING
    image.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw My head hurts....
    Haven't eaten for shit really and have only been doing this all day
    Taking a break now...

    ai,
    @ai@cawfee.club avatar

    @TURBORETARD9000 @ceo_of_monoeye_dating @sjw @p @jeffcliff Go eat something! Make sure you get enough sleep too

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @sjw @p @jeffcliff I've left off in the middle of the compressed instruction decoder, so that I can use it to control the instruction length plexer and it doesn't change anything about the later stages (yet, will need exceptions and traps eventually)
    Control lines are so much more clean now, and getting more clean as I go
    To be fair I'm stealing it from RIPES but I can work from there

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw almost done with quadrant 2, thinking about going ahead and throwing in the exception generation logic while I'm at it
    Had fun getting flood trapped away from home yesterday but it ended up resulting in me getting 12 hours of sleep so yeah

    TURBORETARD9000,
    jeffcliff,
    @jeffcliff@shitposter.club avatar

    LGTM

    adds to notes @TURBORETARD9000 - computer architecture / cs301 complete with ~100% grade

    now we just gotta export this to vhdl and somehow get this implemented

    TURBORETARD9000,

    @jeffcliff @ceo_of_monoeye_dating @sjw @ai @p Oh sorry, just the compressed extension
    I've still got a lot of work cleaning up the rest of the pipeline
    Biting the bullet and using subcircuits, at the cost of having all the logic front and center to look at
    Cleaned up the decode stage
    image.png

    TURBORETARD9000,

    @jeffcliff @ai @ceo_of_monoeye_dating @p @sjw And if we want to talk about VHDL...
    Well there's already better implementations that actually have interrupt logic and formal verification
    Eventually, though
    Gotta catch up on finances (again) and then I plan on getting a proper dev board

    jeffcliff,
    @jeffcliff@shitposter.club avatar

    deleted_by_author

  • Loading...
  • TURBORETARD9000,

    @jeffcliff @ceo_of_monoeye_dating @sjw @ai @p I'm gonna lean towards the standard, I want to eventually load compiled elf binaries with this thing

    jeffcliff,
    @jeffcliff@shitposter.club avatar

    deleted_by_author

  • Loading...
  • jeffcliff,
    @jeffcliff@shitposter.club avatar

    deleted_by_author

  • Loading...
  • TURBORETARD9000,

    @jeffcliff @ceo_of_monoeye_dating @sjw @ai @p it's beautiful
    It's gorgeous
    It's simple
    It's OPEN SOURCE

    jeffcliff,
    @jeffcliff@shitposter.club avatar

    deleted_by_author

  • Loading...
  • TURBORETARD9000,

    @jeffcliff @ceo_of_monoeye_dating @sjw @ai @p Well there really isn't a way for this sim to access external programs or devices, but there is simulated MMIO like VGA, a terminal, a keyboard, 7-segment displays and such
    I'm stuck designing the busses though

    TURBORETARD9000,

    @jeffcliff @ai @ceo_of_monoeye_dating @p @sjw Also it's all running in Java so I'm gonna have to fuck around with heap space, otherwise I'm stuck with 24-bit memory blocks

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw need the hazard and forwarding units and should be fully functional once I'm there, minus syscalls and traps and shit
    There's a few things I need to tinker with to simplify but I can worry about that later
    image.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw My control unit is a huge mess of combinational logic
    It's so easy to tell a lot of lines were forced to be translated into and out of enum values
    And it's all going to have to be redone as soon as I try to add more features
    But it works, I think

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw aaand the forwarding unit

    Going through trying to hook them up and I'm seeing control lines that aren't explicitly diagrammed by RIPES and look suspiciously like things I need more ISA for...
    REEEEEE
    Getting closer
    image.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw most notable, it seems like the ecall checker used by RIPES is specifically designed to hook into the external program, which I obv can't do if I want to follow the standard or like
    Treat it like physical hardware
    I am far beyond the point where I have any actual understanding of what I'm doing
    If anyone knows more what I'm looking at or knows someone who does any input or tips would be appreciated, it's a lot more helpful than just staring at the same doc pages all day (am afk atm, at work)

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Let's see, external IO...
    That means I'm probably going to want an external reset pin, especially if I want to add multiple cores and threads, an external interrupt pin, whatever pins UART or whatever analogue I decide to use needs...
    I'm probably going to have to rewrite it halfway from scratch just to manage new cabling

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Oh, and control lines for cache once I get to it

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Actually
    Yeah
    I wanna get to the all out point eventually
    8 harts, 4 cores
    L1 through L3 cache, 8 ways
    PCI of some sort
    Vector extensions at some point
    Full privileged ISA support
    The whole shebang

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw fuckkk me nvm on the fancy stuff for now
    I forgot things like PCI use special signaling and things to work
    So
    As external interface to a theoretical processor, knowing what I know about, say, the 8086, I know I'd need...

    A Non-Maskable Interrupt pin
    A maskable Interrupt
    External reset
    Data bus
    Address bus
    Write/read enable for memory access

    Looks like I might need Cache Flush and Enable, as well as maybe a way to implement Burst Access?

    A lot of the pins are x86 specific (duh) so I'm uncertain how many of these need to be kept between ISAs

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw As for CSRs, it looks like RW instructions occur akin to GPR RW, with actual control fields dropping out the side

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I'd say I'd like to reach a point where this thing could be fabbed and be a drop-in replacement for Intel or AMD but I realize that motherboard sockets and designs themselves are locked into x86

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw ughhhh trying not to burn out on this
    Ok
    So
    I just want, to begin with
    One RV64GC core
    I'm okay with emulating atomics if need be
    I would like CLINT if possible
    Some sort of cache and burst mode addressing will probably be needed for that
    But I want it to be ready to add another hart at some point

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw There's plenty of IP cores available but they all rely on FPGAs and AXI and shit and I'm not ready for that :blobcatfearful:

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Reading verilog is a bit annoying

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw fuck it
    Trying to implement https://www.github.com/ultraembedded/biriscv
    RV32IMZicsr, dual-issue 6/7 stage, BTB, RAS, User/Supervisor privilege support, TCM support
    The more I look at the code the more I'm starting to understand how to translate it
    .. mostly

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw I'm getting more comfortable with the thought of AXI now that I'm seeing how 1) logisim has combinatorial and FSM generation
    And 2) verilog lays them out pretty plainly

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw So far so good, working on dcache
    It's 2-way set-associative, random replacement, write-back cache

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw that's pretty cool actually
    Would generate a priority encoder

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw all I need to do is add the AXI controller and the dcache should be complete

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw ye almost there
    After that I'll organize and show it off side-by-side with the Verilog

    sjw,
    @sjw@bae.st avatar
    ceo_of_monoeye_dating,
    @ceo_of_monoeye_dating@bae.st avatar

    @sjw @TURBORETARD9000 @ai @jeffcliff @p Saw it, haven't read the paper yet, have no opinion.

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw dcache constructed, organization of inner components is next
    image.png

    TURBORETARD9000,
    TURBORETARD9000,
    TURBORETARD9000,
    TURBORETARD9000,
    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw ok last one (and the forgotten fsm, data ram)
    Seven attachments, mastodon incompatibility warning
    image.png
    image.png
    image.png
    image.png
    image.png
    dcache_if_pmem.v
    dcache_core_data_ram.v

    image.png
    image.png
    image.png
    image.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw This is the topmost file, each cache and the CPU will get dropped here
    And by that I mean temporarily, and then I'll move the caches down a layer into the CPU once I'm sure things are working
    image.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw THAT BEING SAID
    I am now tired
    I am going to have to repeat a lot of this to do the icache (Not all of it thank god, but it has a slightly different FSM and AXI interface it seems)

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw If any of you can spot any errors or criticisms please feel free, I most likely don't know better

    ceo_of_monoeye_dating,
    @ceo_of_monoeye_dating@bae.st avatar

    @TURBORETARD9000 @ai @jeffcliff @p @sjw Neither do I. I barely scraped through my Comp Arch class, and that was more than 10 years ago. I can maybe give broad suggestions sometimes but that's it.

    TURBORETARD9000,

    @ceo_of_monoeye_dating @ai @jeffcliff @p @sjw I guess we're both learning things here then!

    TURBORETARD9000,

    @ceo_of_monoeye_dating @ai @jeffcliff @p @sjw I have the Risc-V ISA specs on hand, need to grab AMBA4 for the AXI spec
    After that fuck if I know what docs I need to grab to understand what I'm doing

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Also it seems I could've done just the CPU and TCM (fuck yeah we got that too, 64KB of it) and that would've been enough to test the CPU itself
    I'm not complaining tho

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw ughhh ok so I know this is a mux but it always bugs me when 1) they define what looks like the default statement up at the top under begin but then have a different default below, and 2) when there's more mux input slots than case statements
    It feels weird
    image.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw Ok I finished both icache and dcache
    I need to figure out how to test them before going further, because it's just gonna piss me off if I get everything finished and pieces don't work
    dcache
    icache

    icache

    jeffcliff,
    @jeffcliff@shitposter.club avatar

    deleted_by_author

  • Loading...
  • TURBORETARD9000,

    @jeffcliff @ceo_of_monoeye_dating @sjw @ai @p This is an examplke of what ius in actaul IRL processors
    Well, sorta, most processors nowadays are like
    8-way, LRU replacement policy caches
    Onde I test these I can easily upgrade

    TURBORETARD9000,

    @jeffcliff @ai @ceo_of_monoeye_dating @p @sjw That being said
    I don't quite know how to test these yet
    I have a surface understanding each of AXI, cache, and test vectors but I'll still need to experiment how to put those pieces together
    Also will need to eventually figure out how to upgrade these to 64-bit words for RV64

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @p @sjw @mischievoustomato hey you might find this thread interesting

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw wait I forgot the part where I test the caches
    Ah well

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw I JUST REMEMBERED THIS IMPL HAS BRANCH TABLES
    WOOOO

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw oh boy this is already getting very interesting
    What does 'integer' mean in verilog?
    I'm already confused by the return address stack
    This is gonna be fun!

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw aight that's it for tonight, had to create a RAM from scratch because I can't have both RAM and a non-zero reset value with the stock parts

    TURBORETARD9000,
    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw The beginnings of speculative execution
    image.png

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw ooh need to do the RAS stack dance again for the BHT saturation stack

    sjw,
    @sjw@bae.st avatar
    TURBORETARD9000,

    @sjw @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p help my computer keeps opening up 2g1c and I can't stop it

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw uh oh
    Apparently clr sets all the flops to Zero, not the initial value
    shit

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw I think I know how to work around it, but it depends how important asynchronous reset is
    If it's mandatory I may be fucked on that front

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw No I'm not just tie the reset line to clk smh

    TURBORETARD9000,
    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw and AGAIN the BHT stack needs to be dual port
    REEEEEE
    Simple fix eh

    TURBORETARD9000,

    @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p @sjw I haven't eaten all day
    Should probably fix that before I go any further
    image.png

    sjw,
    @sjw@bae.st avatar
    TURBORETARD9000,

    @sjw @ai @ceo_of_monoeye_dating @jeffcliff @mischievoustomato @p I already have one of those on my face though
    That being said I do want one of those dog-nose chemical detectors, they're really cool

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • Hentai
  • doujinshi
  • announcements
  • general
  • All magazines