Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - How to overide ieee.std_logic_1164.all

 
Thread Tools Search this Thread
Old 06-12-2006, 09:57 PM   #1
Default How to overide ieee.std_logic_1164.all


The thing is I want to include the ieee.std_logic_1164.all library in
the project but i want to redefine the XOR by mine.(I want to override
XOR so that it will have a delay).How should i do that?
I can not use a custom made component and map all the current XOR to
it.Also my experience with VHDL is limited so any advice will be more
than welcome!





Nikos
  Reply With Quote
Old 06-12-2006, 10:13 PM   #2
Jim Lewis
 
Posts: n/a
Default Re: How to overide ieee.std_logic_1164.all
Nikos wrote:
> The thing is I want to include the ieee.std_logic_1164.all library in
> the project but i want to redefine the XOR by mine.(I want to override
> XOR so that it will have a delay).How should i do that?
> I can not use a custom made component and map all the current XOR to
> it.Also my experience with VHDL is limited so any advice will be more
> than welcome!
>

Functions cannot have a delay. Sorry.

So if you want a delay and you don't want to write something
like:

Y <= A xor B after 10 ns ;

and you want to use a subprogram, then you must write a
procedure (a subprogram that can have a delay), however,
note that a procedure is a statement, so the output is
part of the call:

XOR_DELAYED (Y, A, B) ;

You can find the syntax for a procedure in any book or maybe the
FAQ which can be found at: http://www.vhdl.org

Good Luck,
Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
Jim Lewis
Director of Training private.php?do=newpm&u=
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~


Jim Lewis
  Reply With Quote
Old 06-12-2006, 11:25 PM   #3
Nikos
 
Posts: n/a
Default Re: How to overide ieee.std_logic_1164.all
Jim Lewis wrote:
> Nikos wrote:
>> The thing is I want to include the ieee.std_logic_1164.all library in
>> the project but i want to redefine the XOR by mine.(I want to override
>> XOR so that it will have a delay).How should i do that?
>> I can not use a custom made component and map all the current XOR to
>> it.Also my experience with VHDL is limited so any advice will be more
>> than welcome!
>>

> Functions cannot have a delay. Sorry.

I didn't mention functions somewhere?Did I?

> So if you want a delay and you don't want to write something
> like:
>
> Y <= A xor B after 10 ns ;
>
> and you want to use a subprogram, then you must write a
> procedure (a subprogram that can have a delay), however,
> note that a procedure is a statement, so the output is
> part of the call:
>
> XOR_DELAYED (Y, A, B) ;
>

Actually I want only to override the xor of the ieee.That would
suffice.If I try to have something like a component XOR_DELAYED() then
that would mean a huge change of code that is not possible.The same
applies to adding: "after 10 ns".

The question is: is there a way to OVERRIDE XOR?I don't want to overload
(in software engineering terms) the XOR.



> You can find the syntax for a procedure in any book or maybe the
> FAQ which can be found at: http://www.vhdl.org
>
> Good Luck,
> Jim


Thanks


Nikos
  Reply With Quote
Old 06-12-2006, 11:48 PM   #4
Mike Treseler
 
Posts: n/a
Default Re: How to overide ieee.std_logic_1164.all
Nikos wrote:

> I didn't mention functions somewhere? Did I?


You mentioned ieee.std_logic_1164.xor

Let's have a look:

FUNCTION "xor" ( l : std_ulogic; r : std_ulogic ) RETURN UX01;

Looks like a function to me.

> Actually I want only to override the xor of the ieee.That would
> suffice.If I try to have something like a component XOR_DELAYED() then
> that would mean a huge change of code that is not possible.


When I overload a function, there is no change to the code.
It just refines what the existing function calls will do.

> The question is: is there a way to OVERRIDE XOR?I don't want to overload
> (in software engineering terms) the XOR.


No.

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 06-12-2006, 11:55 PM   #5
Nikos
 
Posts: n/a
Default Re: How to overide ieee.std_logic_1164.all
Mike Treseler wrote:
> Nikos wrote:
>
>> I didn't mention functions somewhere? Did I?

>
> You mentioned ieee.std_logic_1164.xor
>
> Let's have a look:
>
> FUNCTION "xor" ( l : std_ulogic; r : std_ulogic ) RETURN UX01;
>
> Looks like a function to me.
>

Didn't know that there was a function behind...Actually I was hoping
that it wasn't one.


>> Actually I want only to override the xor of the ieee.That would
>> suffice.If I try to have something like a component XOR_DELAYED() then
>> that would mean a huge change of code that is not possible.

>
> When I overload a function, there is no change to the code.
> It just refines what the existing function calls will do.
>
>> The question is: is there a way to OVERRIDE XOR?I don't want to
>> overload (in software engineering terms) the XOR.

>
> No.
>

Bad

> -- Mike Treseler


Thank you!
Nikos


Nikos
  Reply With Quote
Old 06-13-2006, 12:11 PM   #6
KJ
 
Posts: n/a
Default Re: How to overide ieee.std_logic_1164.all
>>
>>> The question is: is there a way to OVERRIDE XOR?I don't want to overload
>>> (in software engineering terms) the XOR.

>>
>> No.
>>

> Bad
>


Perhaps back up a step and explain what the real problem is that adding a
delay to xor would solve. That might suggest a better approach to the real
problem.

KJ




KJ
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46