EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

assert question

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - VHDL Language - assert question

Benjamin Couillard
Guest

Thu Mar 10, 2011 4:51 pm   



Hi everyone,

I was wondering if I can do the following in VHDL :

my_process : process(CLK)
begin
if rising_edge(CLK) then
if (load_reg = '1') then
assert unsigned(DATA) > 10
report "error, DATA must be greater than 10"
severity error;
end if;
end if;
end process;

I've tried the following code in Active-HDL, and no assertions were
triggered in simulation even though there should have. Is it supposed
to trigger? Is there another way to write that assertion?

Best regards

Tricky
Guest

Thu Mar 10, 2011 5:17 pm   



On Mar 10, 2:51 pm, Benjamin Couillard <benjamin.couill...@gmail.com>
wrote:
Quote:
Hi everyone,

I was wondering if I can do the following in VHDL :

my_process : process(CLK)
begin
   if rising_edge(CLK) then
     if (load_reg = '1') then
            assert unsigned(DATA) > 10
            report "error, DATA must be greater than 10"
            severity error;
     end if;
   end if;
end process;

I've tried the following code in Active-HDL, and no assertions were
triggered in simulation even though there should have. Is it supposed
to trigger? Is there another way to write that assertion?

Best regards

Theres nothing wrong with the code. I can only assume that DATA is
greater than 10 whenever the process triggers. Or load_reg = '0'.

Benjamin Couillard
Guest

Thu Mar 10, 2011 5:20 pm   



On 10 mar, 10:17, Tricky <trickyh...@gmail.com> wrote:
Quote:
On Mar 10, 2:51 pm, Benjamin Couillard <benjamin.couill...@gmail.com
wrote:









Hi everyone,

I was wondering if I can do the following in VHDL :

my_process : process(CLK)
begin
   if rising_edge(CLK) then
     if (load_reg = '1') then
            assert unsigned(DATA) > 10
            report "error, DATA must be greater than 10"
            severity error;
     end if;
   end if;
end process;

I've tried the following code in Active-HDL, and no assertions were
triggered in simulation even though there should have. Is it supposed
to trigger? Is there another way to write that assertion?

Best regards

Theres nothing wrong with the code. I can only assume that DATA is
greater than 10 whenever the process triggers. Or load_reg = '0'.

Ok, I found out what the problem was. I was using variables instead of
signals in the assert statement (I simplified my statement a bit to
make it easier to understand) and I didn't realize that it would solve
the problem.

Don Otknow
Guest

Thu Mar 10, 2011 11:01 pm   



On Mar 10, 7:20 am, Benjamin Couillard <benjamin.couill...@gmail.com>
wrote:
Quote:
On 10 mar, 10:17, Tricky <trickyh...@gmail.com> wrote:









On Mar 10, 2:51 pm, Benjamin Couillard <benjamin.couill...@gmail.com
wrote:

Hi everyone,

I was wondering if I can do the following in VHDL :

my_process : process(CLK)
begin
   if rising_edge(CLK) then
     if (load_reg = '1') then
            assert unsigned(DATA) > 10
            report "error, DATA must be greater than 10"
            severity error;
     end if;
   end if;
end process;

I've tried the following code in Active-HDL, and no assertions were
triggered in simulation even though there should have. Is it supposed
to trigger? Is there another way to write that assertion?

Best regards

Theres nothing wrong with the code. I can only assume that DATA is
greater than 10 whenever the process triggers. Or load_reg = '0'.

Ok, I found out what the problem was. I was using variables instead of
signals in the assert statement (I simplified my statement a bit to
make it easier to understand) and I didn't realize that it would solve
the problem.

I thought variables can only be declared in processes and thus their
scope
only extends to the process they're declared in? So then by your
example
my_process should not have been able to see DATA or load_reg,
whichever was
declared as a variable. Could you post the non-simplified code? I'm
curious.

Tricky
Guest

Fri Mar 11, 2011 1:52 pm   



On Mar 10, 9:01 pm, Don Otknow <donald.otk...@gmail.com> wrote:
Quote:
On Mar 10, 7:20 am, Benjamin Couillard <benjamin.couill...@gmail.com
wrote:



On 10 mar, 10:17, Tricky <trickyh...@gmail.com> wrote:

On Mar 10, 2:51 pm, Benjamin Couillard <benjamin.couill...@gmail.com
wrote:

Hi everyone,

I was wondering if I can do the following in VHDL :

my_process : process(CLK)
begin
   if rising_edge(CLK) then
     if (load_reg = '1') then
            assert unsigned(DATA) > 10
            report "error, DATA must be greater than 10"
            severity error;
     end if;
   end if;
end process;

I've tried the following code in Active-HDL, and no assertions were
triggered in simulation even though there should have. Is it supposed
to trigger? Is there another way to write that assertion?

Best regards

Theres nothing wrong with the code. I can only assume that DATA is
greater than 10 whenever the process triggers. Or load_reg = '0'.

Ok, I found out what the problem was. I was using variables instead of
signals in the assert statement (I simplified my statement a bit to
make it easier to understand) and I didn't realize that it would solve
the problem.

I thought variables can only be declared in processes and thus their
scope
only extends to the process they're declared in? So then by your
example
my_process should not have been able to see DATA or load_reg,
whichever was
declared as a variable. Could you post the non-simplified code? I'm
curious.

shared variabled can be placed inside architectures and read by all
processes.

elektroda.net NewsGroups Forum Index - VHDL Language - assert question

Ask a question - edaboard.com

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony