How to overide ieee.std_logic_1164.all

N

Nikos

Guest
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 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 mailto:Jim@SynthWorks.com
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

Expert VHDL Training for Hardware Design and Verification
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
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 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 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
 
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
 

Welcome to EDABoard.com

Sponsor

Back
Top