A
Andy
I would have preferred a solution with a kind of "shared variable",
but this seems not to work!?
Thanks
Peter
Do you want a solution, or do you want to use shared variables? Pick
one.
Andy
I would have preferred a solution with a kind of "shared variable",
but this seems not to work!?
Thanks
Peter
Because every time you call NextAddress, it changes the address. So
You would have to get lucky for the incoming address to match in the
ever changing match. Setting it to a constant means it never changes.
Asserts can be placed almost anywhere. for what you want, just put it
inside the architecture.
Try this:
assert false report my_ent'PATH_NAME & ": Address of something = " &
integer'image(ConstantAddress) severity NOTE;
Now, as discussed previously in another thread, asserts get treated
different by different synthesisors. I Know Quartus handles them very
well, but other synthesisors either ignore them or mishandle them and
just print Failures/errors as warnings!
"Direct use of the function "NextAddress" in the comparator gives no
syntax error it simply does not work!!?? "
It really works, but in a different way from your expecting respect.
You use "ModuleAddress" function in order to set a constant which is
called during synthesization.
Your "ModuleAddress" function in comparator is called when it is used
in implementation.
You didn't test to see "ModuleAddress" function in implementation.
Tricky said:Try this:
assert false report my_ent'PATH_NAME & ": Address of something = " &
integer'image(ConstantAddress) severity NOTE;
This would have been what i wanted!
But even here, when i look at the RTL Schematic, i still see the adder
from the impure function!
It seems the synthesis does NOT really use it as a constant!!!???
This is really the main point!
My code is still in work and constantly changing. This is meant by
"removing"! I really want to be able to remove/substitute/add modules
in the source code without having to change too much in other parts
(functions)!
As far as i understand, you put the task of address generation into
the generation of constant vectors, which are then finally used!
These
vectors have to be linked "manually", by using the next proper start
adresses (range.right) as paramter in "Create_Addresses()". The task
of linking the addresses remains (the crucial problem!).
And again, if
i have to change my code i have to be very careful to reestablish the
linking!
Again, I thought there is a much simpler solution (something like
"impure functions" see below!)
But your proposal (in contrary to mine) is interesting anyway! Maybe
it simplifies overall editing of my code! Give me some time and i will
give it a try!
That because it is NOT constant.
the line of code you had:
y <= '1' when Conv_integer(x)=NextAddress else '0';
is really a process that looks like this:
process(x)
begin
if Conv_integer(x) = NextAddress then
y <= '1';
else
y <= '0';
end;
end process;
Because of this, next address is called every time x changes. Meaning
that the address incremenets for every change on X. Hence why XST put
an adder into the circuit.
Hi Tricky!
Yes, i understand this, but as i said, i used this code:
architecture Behavioral of MyModule is
constant ModuleAddress: integer := NextAddress;
begin
y <= '1' when Conv_integer(x)=ModuleAddress else '0';
end Behavioral;
So, i first generate the constant ModuleAddress, which seems to work
fine in the Simulator, but fails in the implementation!
Peter
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.