How to overide ieee.std_logic_1164.all

N

Nikos

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!
 
J

Jim Lewis

Nikos said:
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:[email protected]
SynthWorks Design Inc. http://www.SynthWorks.com
1-503-590-4787

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

Nikos

Jim said:
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
 
M

Mike Treseler

Nikos said:
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
 
N

Nikos

Mike said:
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.

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


No.
Bad :(
-- Mike Treseler

Thank you!
Nikos
 
K

KJ


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top