S2.17.1 Read the Name

EasyImplement12 minIcarus Verilog · serverReview the topic

Read four ISA names, decide which software runs on which processor, and count the cost of a multiply without M.

Hardware context: A multiply by repeated addition on a small model of an RV32I processor, and one addition in registers of 32 and of 64 bits, as test code. Choosing the ISA name of a processor and building software for it

Four processors are named RV32I, RV32IMC, RV32IMAC and RV64GC. The letter G is short for I, M, A, F and D. The last four entries are about the multiply loop of the lesson. It clears x12, and then adds x10 into x12 once for each count in x11.

This worksheet uses named constants. The first three entries show how to record your decisions.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
The multiply loop
Addresses are in hex. The loop runs on RV32I.
AddressInstruction
00addi x12, x0, 0
04beq x11, x0, 0x14
08add x12, x12, x10
0caddi x11, x11, -1
10bne x11, x0, 0x8
14ebreak

Enter every number in decimal. For a yes or no question, enter 1 for yes and 0 for no.

EntryYour decision
WIDTH_RV32IMCHow many bits wide is a register of RV32IMC?
MUL_ON_RV32IMCDoes RV32IMC have a multiply instruction?
ATOMIC_ON_RV32IMCDoes RV32IMC have the atomic operations?
WIDTH_RV64GCHow many bits wide is a register of RV64GC?
MUL_ON_RV64GCDoes RV64GC have a multiply instruction?
INSTRUCTION_BITS_RV64IHow many bits long is an instruction of RV64I?
RUN_IM_ON_IMACDoes a program built for RV32IM run on RV32IMAC?
RUN_IMAC_ON_IMCDoes a program built for RV32IMAC run on RV32IMC, if it uses atomic operations?
RUN_RV32I_ON_RV64GCDoes a program built for RV32I run on RV64GC as it is?
RUN_IMC_ON_IDoes a program built for RV32IMC run on RV32I, if it multiplies?
TURNS_FOR_5_TIMES_4The loop starts with 5 in x10 and 4 in x11. How many times does the add at 08 run?
X12_FOR_5_TIMES_4What does x12 hold at the ebreak, for 5 in x10 and 4 in x11?
INSTRUCTIONS_FOR_5_TIMES_4How many instructions run before the ebreak, for 5 in x10 and 4 in x11?
INSTRUCTIONS_FOR_BThe loop starts with B in x11. Give the number of instructions that run before the ebreak, as an expression in B.

Examples

Example 1

WIDTH RV32IMC
Input
How many bits wide is a register of RV32IMC?
Output
matches = 1

The number in the name is the width of a register.

Example 2

MUL ON RV32IMC
Input
Does RV32IMC have a multiply instruction?
Output
matches = 1

The letter M is multiply and divide.

Example 3

ATOMIC ON RV32IMC
Input
Does RV32IMC have the atomic operations?
Output
matches = 1

There is no letter A in the name.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For INSTRUCTIONS_FOR_B, enter a constant expression using B. Only this entry changes with the parameter. The supported integer range is 7 through 84, inclusive.

Hints

Hint 1

Write the name as RV, a number and letters. Replace G with I, M, A, F and D.

Hint 2

A program runs when the processor has the same width and every letter that the program uses.

Hint 3

Count the instructions of one turn of the loop, and the ones that run only once.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

14 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 1 problem on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

WIDTH RV32IMC

Input
How many bits wide is a register of RV32IMC?
Expected output
matches = 1

The number in the name is the width of a register.

Run samples executes all 3 public checks. Check all tests runs 14 checks on the server.

Icarus Verilog · server