[Oberon] Fast version of Oberon RISC5 for Pepino

Magnus Karlsson magnus at saanlima.com
Tue Mar 1 17:14:30 CET 2016


Hmm, I did not know.  As far as I can see, that code is not used by any 
of the hardware implementations available on Paul Reed's web site.
My version is very intuitive (z <= x * y), completely portable to any 
other architecture that has built-in multipliers, and performs as fast 
as Prof Wirth's non-portable version.

BTW, I have made a small change to the code.  Xilinx uses a different 
Verilog parser for the older Spartan-3 parts and it requires all 
instantiated modules to have a module name.
Here is the updated version with instance names for the multipliers (in 
bold):

`timescale 1ns / 1ps   // MK 29.2.2016

module Multiplier(
   input clk, run, u,
   output stall,
   input [31:0] x, y,
   output [63:0] z);

wire [63:0] z_signed, z_unsigned;
reg [63:0] P;
reg S;

assign z = P;
assign stall = run & ~S;

mult_signed *mult_s*(.x(x), .y(y), .z(z_signed));
mult_unsigned *mult_us*(.x(x), .y(y), .z(z_unsigned));

always @ (posedge(clk)) begin
   P <= u ? z_unsigned : z_signed;
   S <= run;
end

endmodule

module mult_signed (
   input signed [31:0] x,
   input signed [31:0] y,
   output signed [63:0] z);

assign z = x * y;

endmodule

module mult_unsigned (
   input [31:0] x,
   input [31:0] y,
   output [63:0] z);

assign z = x * y;

endmodule


This code will compile for the Spartan-3 used on the Digilent S3 board 
and the OberonStation board.

Cheers,
Magnus




On 3/1/2016 3:45 AM, Chris Burrows wrote:
>> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
>> Magnus Karlsson
>> Sent: Tuesday, 1 March 2016 10:31 AM
>> To: oberon at lists.inf.ethz.ch
>> Subject: Re: [Oberon] Fast version of Oberon RISC5 for Pepino
>>
>> The current RISC5 verilog code does not take advantage of the fact
>> the both
>> Spartan3 and Spartan6 have hardware multipliers
> There are two versions of Multiplier still available on Prof Wirth's site.
> One which is portable (Multiplier.v) and one which uses the fast 18 x 18 bit
> multiplier units (Multiplier1.v):
>
> https://www.inf.ethz.ch/personal/wirth/ProjectOberon
>
> Regards,
> Chris Burrows
> CFB Software
>
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20160301/d52382ae/attachment.html>


More information about the Oberon mailing list