<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">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.<br>
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.<br>
<br>
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.<br>
Here is the updated version with instance names for the
multipliers (in bold):<br>
<br>
<font face="Courier New, Courier, monospace">`timescale 1ns /
1ps // MK 29.2.2016<br>
<br>
module Multiplier(<br>
input clk, run, u,<br>
output stall,<br>
input [31:0] x, y,<br>
output [63:0] z);<br>
<br>
wire [63:0] z_signed, z_unsigned;<br>
reg [63:0] P;<br>
reg S;<br>
<br>
assign z = P;<br>
assign stall = run & ~S;<br>
<br>
mult_signed <b>mult_s</b>(.x(x), .y(y), .z(z_signed));<br>
mult_unsigned <b>mult_us</b>(.x(x), .y(y), .z(z_unsigned));<br>
<br>
always @ (posedge(clk)) begin<br>
P <= u ? z_unsigned : z_signed;<br>
S <= run;<br>
end<br>
<br>
endmodule<br>
<br>
module mult_signed (<br>
input signed [31:0] x,<br>
input signed [31:0] y,<br>
output signed [63:0] z);<br>
<br>
assign z = x * y;<br>
<br>
endmodule<br>
<br>
module mult_unsigned (<br>
input [31:0] x,<br>
input [31:0] y,<br>
output [63:0] z);<br>
<br>
assign z = x * y;<br>
<br>
endmodule</font><br>
<br>
<br>
This code will compile for the Spartan-3 used on the Digilent S3
board and the OberonStation board.<br>
<br>
Cheers,<br>
Magnus <br>
<br>
<br>
<br>
<br>
On 3/1/2016 3:45 AM, Chris Burrows wrote:<br>
</div>
<blockquote
cite="mid:002501d173af$cdb50a40$691f1ec0$@cfbsoftware.com"
type="cite">
<blockquote type="cite">
<pre wrap="">
From: Oberon [<a class="moz-txt-link-freetext" href="mailto:oberon-bounces@lists.inf.ethz.ch">mailto:oberon-bounces@lists.inf.ethz.ch</a>] On Behalf Of
Magnus Karlsson
Sent: Tuesday, 1 March 2016 10:31 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:oberon@lists.inf.ethz.ch">oberon@lists.inf.ethz.ch</a>
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
</pre>
</blockquote>
<pre wrap="">
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):
<a class="moz-txt-link-freetext" href="https://www.inf.ethz.ch/personal/wirth/ProjectOberon">https://www.inf.ethz.ch/personal/wirth/ProjectOberon</a>
Regards,
Chris Burrows
CFB Software
--
<a class="moz-txt-link-abbreviated" href="mailto:Oberon@lists.inf.ethz.ch">Oberon@lists.inf.ethz.ch</a> mailing list for ETH Oberon and related systems
<a class="moz-txt-link-freetext" href="https://lists.inf.ethz.ch/mailman/listinfo/oberon">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a>
</pre>
</blockquote>
<br>
</body>
</html>