Welcome to Libre-SOC’s documentation!

simple core issuer

not in any way intended for production use. this runs a FSM that:

  • reads the Program Counter from StateRegs
  • reads an instruction from a fixed-size Test Memory
  • issues it to the Simple Core
  • waits for it to complete
  • increments the PC
  • does it all over again

the purpose of this module is to verify the functional correctness of the Function Units in the absolute simplest and clearest possible way, and to at provide something that can be further incrementally improved.

class soc.simple.issuer.TestIssuerInternal(pspec)

TestIssuer - reads instructions from TestMemory and issues them

efficiency and speed is not the main goal here: functional correctness and code clarity is. optimisations (which almost 100% interfere with easy understanding) come later.

do_dmi(m, dbg)

deals with DMI debug requests

currently only provides read requests for the INT regfile, CR and XER it will later also deal with writing to these regfiles.

execute_fsm(m, core, pc_changed, sv_changed, exec_insn_valid_i, exec_insn_ready_o, exec_pc_valid_o, exec_pc_ready_i)

execute FSM

execute FSM. this interacts with the “issue” FSM through exec_insn_ready/valid (incoming) and exec_pc_ready/valid (outgoing). SVP64 RM prefixes have already been set up by the “issue” phase, so execute is fairly straightforward.

fetch_fsm(m, core, pc, svstate, nia, is_svp64_mode, fetch_pc_ready_o, fetch_pc_valid_i, fetch_insn_valid_o, fetch_insn_ready_i)

fetch FSM

this FSM performs fetch of raw instruction data, partial-decodes it 32-bit at a time to detect SVP64 prefixes, and will optionally read a 2nd 32-bit quantity if that occurs.

fetch_predicate_fsm(m, pred_insn_valid_i, pred_insn_ready_o, pred_mask_valid_o, pred_mask_ready_i)
fetch_predicate_fsm - obtains (constructs in the case of CR)
src/dest predicate masks

https://bugs.libre-soc.org/show_bug.cgi?id=617 the predicates can be read here, by using IntRegs r_ports[‘pred’] or CRRegs r_ports[‘pred’]. in the case of CRs it will have to be done through multiple reads, extracting one relevant at a time. later, a faster way would be to use the 32-bit-wide CR port but this is more complex decoding, here. equivalent code used in ISACaller is “from openpower.decoder.isa.caller import get_predcr”

note: this ENTIRE FSM is not to be called when svp64 is disabled

issue_fsm(m, core, pc_changed, sv_changed, nia, dbg, core_rst, is_svp64_mode, fetch_pc_ready_o, fetch_pc_valid_i, fetch_insn_valid_o, fetch_insn_ready_i, pred_insn_valid_i, pred_insn_ready_o, pred_mask_valid_o, pred_mask_ready_i, exec_insn_valid_i, exec_insn_ready_o, exec_pc_valid_o, exec_pc_ready_i)

issue FSM

decode / issue FSM. this interacts with the “fetch” FSM through fetch_insn_ready/valid (incoming) and fetch_pc_ready/valid (outgoing). also interacts with the “execute” FSM through exec_insn_ready/valid (outgoing) and exec_pc_ready/valid (incoming). SVP64 RM prefixes have already been set up by the “fetch” phase, so execute is fairly straightforward.

tb_dec_fsm(m, spr_dec)

this is a FSM for updating either dec or tb. it runs alternately DEC, TB, DEC, TB. note that SPR pipeline could have written a new value to DEC, however the regfile has “passthrough” on it so this should be ok.

see v3.0B p1097-1099 for Timeer Resource and p1065 and p1076

soc.simple.issuer.get_predcr(m, mask, name)

decode SVP64 predicate CR to reg number field and invert status this is identical to _get_predcr in ISACaller

soc.simple.issuer.get_predint(m, mask, name)

decode SVP64 predicate integer mask field to reg number and invert this is identical to the equivalent function in ISACaller except that it doesn’t read the INT directly, it just decodes “what needs to be done” i.e. which INT reg, whether it is shifted and whether it is bit-inverted.

  • all1s is set to indicate that no mask is to be applied.
  • regread indicates the GPR register number to be read
  • invert is set to indicate that the register value is to be inverted
  • unary indicates that the contents of the register is to be shifted 1<<r3

Indices and tables