Eilert Backhus
Forum Replies Created
-
AuthorPosts
-
June 28, 2017 at 23:11 #1398Eilert BackhusMember
Hi Jim,
I hoped that there’s some solution using the range notation like you showed:
With named association, you can also do the following:
A <= RndA.DistSlv((0=>5, 1 to 14 =>1, 15=>5), A'length) ;
I just didn’t expect it to be so straight simple, since the defined type is self defined.
You mentioned integer_vectors somewhere else. Are these defined internally in a similar way as DistValSlv is? Does this kind of assignment work with integer_vectors too?Kind regards
EilertJune 28, 2017 at 22:56 #1395Eilert BackhusMemberJune 26, 2017 at 01:51 #1389Eilert BackhusMemberHi Nicolai,
the argument type of DistValSlv is an array with a record of two integers.
I wonder wether the range notation can work here too.
It wold look somewhat like this:
A <= RndA.DistValSlv(
((0,5),
(1 to 14,1),
(15,5)), A'length);If this works not, maybe a function with a case statement can help.
In the function you then write sth. like this:
for position in 0 to 15 loop — 15 might come from some ‘lengh calculation
case position is
when 0 => ReturnVal(position,5);
when 1 to 14 =>ReturnVal(position,1);
when 15 =>ReturnVal(position,5);
end case;
end loop
return ReturnVal;Unless there isn’t some better solution, this might at least be a useful workaround for the moment.
(edit:) But actualy that won’t reduce the code much, unless you have a really big array of random constraints.
Have a nice simulation
Eilert
June 26, 2017 at 01:25 #1388Eilert BackhusMemberHi Jorge,
replacing the integer with a real won’t solve the problem.
Instead, it makes it even worse.
The integer data type uses 32 bits (signed) so you have a numerical range of -2^31 to (2^31)-1.
The mantissa of the (32 bit) real data type is just 23 bits wide, which means it has a smaller numerical range (for integer use).
Once you increase the exponent, you are loosing LSBs of the mantissa.
So, while the memory range may grow, you are not able to adress each word in the higher adress regions.
My guess would be to use some unsigned type for the desired purpose.
With unsigned the number of usable adresses can be increased to ranges not yet imaginable for existing memories.
(e.g. can your simulator host computer adress some array of unsigned (2048 downto 0) memory?)
Also, the unsigned data type behaves almost like integer and is compatible (castable) to slv, so it might require less code changes.
But it needs to be checked, wether the conversion functions (e.g. to_integer/to_unsigned) are used, I doubt that they handle larger_than_integer unsigned types properly.
Have a nice simulation
Eilert
May 9, 2017 at 22:41 #1345Eilert BackhusMemberHi Dave,
It might be a little late now, but since you mentioned Modelsim:
There’s a feature of Modelsim called SignalSpy.
With these functions you can access any signal of instances below your testbench, working similar to the way you proposed in the beginning.
Here’s how to use it:
https://www.pldworld.com/_hdl/2/_ref/se_html/manual_html/c_vhdl29.html
Have a nice simulation
Eilert
March 21, 2017 at 23:44 #1320Eilert BackhusMemberHi,
I’ve been using ScoreboardPkg with Questa 10.4c_5 without problems.
If there’s an issue with the 10.4a version maybe upgrading the simulator can help.
Can you provide some example code that causes your Questa version to crash?
Have a nice simulation
Eilert
March 24, 2016 at 00:32 #1154Eilert BackhusMemberHi Martin,
these are the OSVVM packages:
AlertLogPkg.vhd MemoryPkg.vhd NamePkg.vhd OsvvmGlobalPkg.vhd RandomPkg.vhd TextUtilPkg.vhd
CoveragePkg.vhd MessagePkg.vhd OsvvmContext.vhd RandomBasePkg.vhd SortListPkg_int.vhd TranscriptPkg.vhdAnd the word “coreboard” appears just once in it :
AlertLogPkg.vhd: NewAlertLogRec(OSVVM_SCOREBOARD_ALERTLOG_ID, “OSVVM Scoreboard”, ALERTLOG_BASE_ID) ;The relating function just decides about what AlertLog_ID belongs to the Scoreboard, That’s all.
So, what “scoreboard package” are you refering to? There can’t be documentation for a non-existing package.You also say that you have printed training material. From what source? Is there such a package mentioned or provided that is yet unreleased for OSVVM? Don’t you have a cheap scanner somewhere around that can convert it into a PDF? Any multifunctional Priner/Scanner should be able to do this automatically (There are tools to merge front and back pages if you have no double side scanning device).
The Scoreboard does NOT check the responses from the DUT and compares to a reference value.
(That’s why it’s called Scoreboard and not OutputCompare)
It just keeps track of the results coming from some checks.
These might be acheived by comparing output values to some reference value (or reference model output).
But also PSL-Assertions or similar VHDL Checker functions might contribute to the Scoreboard.The actions that are needed are also done using the coverage functions.
Say you have a module with an output value and a number of working modes.
Then you can create a covergroup that combines the modes with the output values (Crosscoverage).
(If there are impossible or unexpected output values, you can use IgnoreBin or IllegalBin to deal with it.)Then you may have some loop like this:
if OutputCheck.IsCovered loop
CreateStimuli();
wait until OutputValid = ‘1’;
If CompareOutput() then
OutputCheck.ICover(Mode,OutputValue);
— maybe do some loggging
else
–Error Actions here
— e.G. Write to OSVVM_SCOREBOARD_ALERTLOG_ID
— But this makes only sense if the errors are non critical and the testbench continues
end loopOnce all output values in all modes appeared correctly you are done.
How fast that happens depends on your input stimuli.Remember what you said :”… the coverage package, which only keeps track of what is tested, …”
Right, and that is not limited to stimuli, but also holds for verified results.Just imagine: Due to some mistake your Testbench fails to change the modes.
From viewing your stimuli everything might look good and well covered.
But your OutputCheck Coverage will never complete and with a simple look at the Coverage report you will see the missing mode change appearing in the OutputCheck Covergroup.I hope this was helpful.
Have a nice simulation
EilertMarch 21, 2016 at 00:34 #1152Eilert BackhusMemberHi,
have you read the “Functional Coverage using CoveragePkg” paper?
There you find explanations about functions like GetBinVal or CountCovHoles etc.
In other words, all the functions you need to examine the scoreboard are described there.
How you are dealing with this information depends on the way you designed your Testbench.Is there anything else you are missing about using the scoreboard?
Have a nice simulation
EilertDecember 6, 2015 at 23:13 #1085Eilert BackhusMemberHi Jim,
thanks for the response.
So it’s most likely a tool issue.
After spotting the error in a new testbench I took an older working testbench and just added the declaration of the shared variable.
Same result. So if you are able to have more than one CovPType variables it has to be the simulator.
Kind regards
Eilert
November 20, 2015 at 04:20 #1077Eilert BackhusMemberHi Jim,
sorrry if my question was not stated properly.
There’s no doubt about using functions in general.
I just wondered wether there’s some reason to have separate function names for each return type rather one function name that is valid for all return types.
But if you say that there’s no technical reason for it and a generic Random function can/will be added in some future release that’s OK.
I just wanted to understand the intentions behind the way you did it.
Kind regards
Eilert
November 19, 2015 at 01:16 #1073Eilert BackhusMemberHi Jim,
thanks for that recommendation.
Meanwhile I found another working solution too.
For using the RandomPType QuestaSim insists that the function has to be impure. I remembered from your documentations that there’s some link between protected types, shared variables and impure functions.
So I came up with this solution:
shared variable RandomData : RandomPType;
impure function DataGenerator(DataWidth : natural) return std_logic_vector is
begin
-- check seed for initial value (from RandomBasePkg Random Seed declaration)
if RandomData.GetSeed = RandomSeedType(integer_vector'(1,7)) then
RandomData.InitSeed(RandomData'instance_name);
report "Info: Seed generated for DataGenerator:RandomData";
end if;
return RandomData.RandSlv(0, 2**Datawidth-1, DataWidth);
end function;And calling the Function like this works just fine:
for i in 0 to 99 loop
wait until falling_edge(clock); -- just creating some delay
DataIn <= DataGenerator(DataIn'length);
wait until rising_edge(clock);
end loop;I think it would work with a procedure as well. (hopefully)
The good thing is that I do not have to double declare the RandomPType outside and inside the function and do not have to transfer the actual values. Instead I just have a constant in the function argument list.
Thanks for reminding me about the Random Package UG.
I saw it was there, but just read the OSVVM UG and the Protected types paper. Somehow I couldn’t resist to try it out immediately. 🙂
Kind regards
Eilert
-
AuthorPosts