Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Alias of a bit in a 2D array

Reply
Thread Tools

Alias of a bit in a 2D array

 
 
Joseph
Guest
Posts: n/a
 
      12-03-2009
Hi all,

I am implementing a serial protocol and I am saving the data and
status bits in 4, 8 bit registers. I have declared an array of 4,
std_logic_vectors 8 bits long using a type.

Now I need an alias for a single bit in the array, example ACK = bit 0
of register 2.

What is the correct syntax to declare it?

I have another question. I have testing out Xilinx ISE and Synplify.
Does each software has its own quirks when writing synthesizable VHDL?
I think the best option is to choose a product and stick with it?

Thanks very much,

Regards,

Joseph
 
Reply With Quote
 
 
 
 
Tricky
Guest
Posts: n/a
 
      12-03-2009
On 3 Dec, 06:59, Joseph <joz...@gmail.com> wrote:
> Hi all,
>
> I am implementing a serial protocol and I am saving the data and
> status bits in 4, 8 bit registers. I have declared an array of 4,
> std_logic_vectors 8 bits long using a type.
>
> Now I need an alias for a single bit in the array, example ACK = bit 0
> of register 2.
>
> What is the correct syntax to declare it?


To create an alias, here is the syntax:

alias ACK : std_logic is my_registers(2)(0);

But according to my Doulos book aliases are not supported by all tools
(I dont really use them, so cant comment on quartus). Why dont yo just
maintain ACK as a single bit register and attach it to the output,
like:

ACK_reg : process(clk)
begin
if rising_edge(clk) then
ACK <= some function;
end if;
end process;

my_regs(2)(0) <= ACK;

This way ACK is always its own register, just tied into a bus.

>
> I have another question. I have testing out Xilinx ISE and Synplify.
> Does each software has its own quirks when writing synthesizable VHDL?
> I think the best option is to choose a product and stick with it?
>


Yes, that is what most people do, normally because the licencing for
the tools is so expensive. But aslong as you keep to the basic coding
templates you shouldnt hit a problem with any tools.
 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      12-05-2009
> On 3 Dec, 06:59, Joseph <joz...@gmail.com> wrote:
>> Hi all,
>>
>> I am implementing a serial protocol and I am saving the data and
>> status bits in 4, 8 bit registers. I have declared an array of 4,
>> std_logic_vectors 8 bits long using a type.
>>
>> Now I need an alias for a single bit in the array, example ACK = bit 0
>> of register 2.


I prefer naming bit fields from the bottom up.
If I first declare ACK and all the other bits
as std_ulogic signals or variables,
I am free to update or structure
them by name, however I like.

Tricky wrote:

> To create an alias, here is the syntax:
> alias ACK : std_logic is my_registers(2)(0);
>
> But according to my Doulos book aliases are not supported by all tools
> (I don't really use them, so cant comment on quartus).


Last I tried, modelsim supports aliases, but does not make them
visible. I could see the underlying object, but not the aliased fields.
This made aliases very uninteresting to me.
So now if I want to see a label, I declare the field as a vhdl object.
But this may have changed. Try it and see.

> Why don't you just
> maintain ACK as a single bit register and attach it to the output...


I agree.
Since I have to declare something in either case,
I see no upside to aliases for sim or synthesis.


-- Mike Treseler
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
reference/alias in perl vs reference/alias in C++ grocery_stocker C++ 9 05-24-2008 04:32 AM
XP X64 Pro, IE7, Delphi 2007, IntraWeb, MS Access, ODBC Alias problem: Insufficient memory for this operation. Alias: SomeDatabase. Skybuck Flying Windows 64bit 13 01-09-2008 07:34 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit, Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new ! vvcd Computer Support 0 09-17-2004 08:15 PM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit,Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new! Ionizer Computer Support 1 01-01-2004 07:27 PM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57