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

system verilog ques. Is there a separate newsgroup for syste

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Verilog Language - system verilog ques. Is there a separate newsgroup for syste

masoodtahir
Guest

Thu Feb 10, 2011 2:47 am   



rand bit [7:0] byte0;
rand bit [7:0] byte1;

The following constraint works:
constraint xyz {
(byte0 >='h41 && byte0 <='h5a) -> byte1
inside {['h41:'h5a]};
(byte0 >='h61 && byte0 <='h7a) -> byte1
inside {['h61:'h7a]};
}

But I want to modify it to something to this effect:
constraint xyz {
(byte0 >='h41 && byte0 <='h5a) -> byte1
inside {['h41:'h5a]} else byte1 inside {['h7b,'h7f]};
(byte0 >='h61 && byte0 <='h7a) -> byte1
inside {['h61:'h7a]} else byte1 inside {['h7b,'h7f]};
}

I get a syntax error for this. What is the correct syntax for this if
it can be done inside a constraint? Or any other suggestion how it can
be done?

Thanks.

Marcus Harnisch
Guest

Thu Feb 10, 2011 1:11 pm   



masoodtahir <masoodtahir_at_hotmail.com> writes:

Quote:
But I want to modify it to something to this effect:
constraint xyz {
(byte0 >='h41 && byte0 <='h5a) -> byte1
inside {['h41:'h5a]} else byte1 inside {['h7b,'h7f]};
(byte0 >='h61 && byte0 <='h7a) -> byte1
inside {['h61:'h7a]} else byte1 inside {['h7b,'h7f]};
}

What is the correct syntax for this if it can be done inside a
constraint?

See LRM (18.5.5 Implication)

,----
| constraint xyz {
| if (byte0 >='h41 && byte0 <='h5a)
| byte1 inside {['h41:'h5a]}
| else byte1 inside {['h7b,'h7f]};
| if (byte0 >='h61 && byte0 <='h7a)
| byte1 inside {['h61:'h7a]}
| else
| byte1 inside {['h7b,'h7f]};
| }
`----

Regards
Marcus

--
note that "property" can also be used as syntactic sugar to reference
a property, breaking the clean design of verilog; [...]

(seen on http://www.veripool.com/verilog-mode_news.html)

elektroda.net NewsGroups Forum Index - Verilog Language - system verilog ques. Is there a separate newsgroup for syste

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