[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] about the ongoing work for the "stable" release



On Fri, Jan 04, 2002 at 02:06:09AM +0100, Yann Guidon wrote:
> hello !
> 
> Michael Riepe wrote:
> > On Wed, Jan 02, 2002 at 04:14:34AM +0100, Yann Guidon wrote:
> > [...]
> > > can anybody have a look at "fanout_linear.vhdl" ?
> > > who can figure why it doesn't work with vanilla ?
> > 
> > It says:
> >         # -- Failure: t: signal has multiple drivers with no resolution function.
> > This is not true, of course - but vanilla doesn't grok it.
> 
> obviously ! but if the error message is inacurate, how could i find the error ?

That's the problem... you can't, normally.

> > This happens
> > when certain combinations of range attributes are used (in particular,
> > 'high and 'low seem to cause problems).  If you use explicit ranges,
> > e.g. `WIDTH-1 downto 0', everything is fine again.
> This is surprising but this can explains a lot of things.
> How did you figure that ?

I had the same problem months ago (fixed it by trial-and-error).

> > I'll attach a fixed version that works for me. But the recursive version
> > will have to wait (BTW: did you mean a recursive entity, or a recursive
> > version of the binary_tree_index function?)
> At least the linear version is a good start, but a "template" for
> recursive functions would be a good start. It's not a high priority, though.

	-- BEWARE! UNTESTED CODE!

	function spread (A : in std_ulogic;
					 log2_width : in natural) return std_ulogic_vector is
		constant L : natural := 2 ** log2_width;
		variably yy : std_ulogic_vector(L-1 downto 0);
		variable tt : std_ulogic;
	begin
		if log2_width >= 2 then
			-- L >= 2**2 = 4
			tt := not A;
			yy(L-1 downto L/2) := spread(tt, log2_width - 1);
			yy(L/2-1 downto 0) := spread(tt, log2_width - 1);
		elsif log2_width = 1 then
			-- L = 2**1 = 2
			yy := (others => not A);
		else
			-- L = 2**0 = 1
			yy := (others => A);
		end if;
		return yy;
	end spread;

Note: this needs an extra input inverter when log2_width is odd.  And I
don't know what synthesis tools will do with it; they'll probably optimize
all the inverters away.

Note #2: I should have made the `fanout factor' a function argument,
or at least a modifiable constant, instead of just using `2' (I guess
a 1:3 or 1:4 tree will be much better). With that modification, the
function might be another candidate for inclusion in `package misc'.
Provided that it works, of course.

[...]
>  - add the INC unit : I found an old "MR" version in the archive and
>    now i have enough VHDL skills to understand it :-)

Where did you find that (filename)?  Must have been a pretty early
version, I don't even remember that I wrote it.  Welcome to the
`f-cpu stone ages' ;)

-- 
 Michael "Tired" Riepe <Michael.Riepe@stud.uni-hannover.de>
 "All I wanna do is have a little fun before I die"
*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/