Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > question of style

Reply
Thread Tools

question of style

 
 
valentin tihomirov
Guest
Posts: n/a
 
      02-08-2004
Below are two architectures (RTL2 and RTL3). They have idendtical behaviour.
Outputs (O1 and O2) are depending on STATE. Which architecure is more
preferrable for FPGA?

Which encoding of states is preferred for FPGAs (onehot, gray, sequential)?

Thanks.


architecture RTL2 of MF is
type STATE_TYPE is
(S0, S1, S2, S3);
signal state: STATE_TYPE;
begin

SEQUENCE : process
begin
-- wait on CLK until CLK = '1';
wait until CLK = '1';
O1 <= '0';
O2 <= '0';
if reset='1' then
STATE <= S0;
else
case STATE is
when S0 =>
O1 <= '0';
O2 <= '0';
STATE <= S1;
when S1 =>
O1 <= '0';
O2 <= '1';
STATE <= S2;
when S2 =>
O1 <= '1';
O2 <= '0';
STATE <= S3;
when S3 =>
O1 <= '1';
O2 <= '1';
STATE <= S0;
end case;
end if;
end process ;

end RTL2;





architecture RTL3 of MF is
type STATE_TYPE is
(S0, S1, S2, S3);
signal state: STATE_TYPE;
begin

COMB: process(STATE)
begin
case STATE is
when S0 =>
O1 <= '0';
O2 <= '0';
when S1 =>
O1 <= '0';
O2 <= '1';
when S2 =>
O1 <= '1';
O2 <= '0';
when S3 =>
O1 <= '1';
O2 <= '1';
end case;
end process;

SEQUENCE : process
begin
wait on CLK until CLK = '1';
-- wait until CLK = '1';

if reset='1' then
STATE <= S0;
else
case STATE is
when S0 =>
STATE <= S1;
when S1 =>
STATE <= S2;
when S2 =>
STATE <= S3;
when S3 =>
STATE <= S0;
end case;
end if;
end process ;

end RTL3;



 
Reply With Quote
 
 
 
 
Vladislav Vasilenko
Guest
Posts: n/a
 
      02-09-2004


valentin tihomirov wrote:

> Below are two architectures (RTL2 and RTL3). They have idendtical behaviour.
> Outputs (O1 and O2) are depending on STATE. Which architecure is more
> preferrable for FPGA?
>
> Which encoding of states is preferred for FPGAs (onehot, gray, sequential)?
>
> Thanks.
>
> architecture RTL2 of MF is
> type STATE_TYPE is
> (S0, S1, S2, S3);
> signal state: STATE_TYPE;
> begin
>
> SEQUENCE : process
> begin
> -- wait on CLK until CLK = '1';
> wait until CLK = '1';
> O1 <= '0';
> O2 <= '0';
> if reset='1' then
> STATE <= S0;
> else
> case STATE is
> when S0 =>
> O1 <= '0';
> O2 <= '0';
> STATE <= S1;
> when S1 =>
> O1 <= '0';
> O2 <= '1';
> STATE <= S2;
> when S2 =>
> O1 <= '1';
> O2 <= '0';
> STATE <= S3;
> when S3 =>
> O1 <= '1';
> O2 <= '1';
> STATE <= S0;
> end case;
> end if;
> end process ;
>
> end RTL2;
>
> architecture RTL3 of MF is
> type STATE_TYPE is
> (S0, S1, S2, S3);
> signal state: STATE_TYPE;
> begin
>
> COMB: process(STATE)
> begin
> case STATE is
> when S0 =>
> O1 <= '0';
> O2 <= '0';
> when S1 =>
> O1 <= '0';
> O2 <= '1';
> when S2 =>
> O1 <= '1';
> O2 <= '0';
> when S3 =>
> O1 <= '1';
> O2 <= '1';
> end case;
> end process;
>
> SEQUENCE : process
> begin
> wait on CLK until CLK = '1';
> -- wait until CLK = '1';
>
> if reset='1' then
> STATE <= S0;
> else
> case STATE is
> when S0 =>
> STATE <= S1;
> when S1 =>
> STATE <= S2;
> when S2 =>
> STATE <= S3;
> when S3 =>
> STATE <= S0;
> end case;
> end if;
> end process ;
>
> end RTL3;


Dear Valentin

from the logic point of view they are equivalent.
But the RTL2 is preferrable
because it provides more higher speed and reusability.
It needs more FFs but FPGA usually contains enough of them.

Regards,

A.Ser.


 
Reply With Quote
 
 
 
 
valentin tihomirov
Guest
Posts: n/a
 
      02-09-2004
> from the logic point of view they are equivalent.
> But the RTL2 is preferrable
> because it provides more higher speed and reusability.
> It needs more FFs but FPGA usually contains enough of them.


Hmm. RTL2 has the same structure as RTL3 but with extra FFs on O1, O2
outputs. How can extra FFs at outputs make design
- faster;
- smaller.
???

IMHO, the thinghs should be vise versa. The fact that a design with
registered outputs is faster comes from my experiense. I could not fit one
design into CPLD but succeeded after FFs were added.


 
Reply With Quote
 
valentin tihomirov
Guest
Posts: n/a
 
      02-10-2004
Shouldn't additional FFs at outputs infer additional one-cycle delay?


 
Reply With Quote
 
Thomas Stanka
Guest
Posts: n/a
 
      02-11-2004
Hello,

"valentin tihomirov" <> wrote:
> Hmm. RTL2 has the same structure as RTL3 but with extra FFs on O1, O2
> outputs. How can extra FFs at outputs make design
> - faster;
> - smaller.
> ???
>
> IMHO, the thinghs should be vise versa. The fact that a design with
> registered outputs is faster comes from my experiense. I could not fit one
> design into CPLD but succeeded after FFs were added.


There are two criterias for faster:
- less cycles per operation
- faster cycles

Infering additional FF could reduces the longest path and lead to more
cycles per timebase. In some cases additional FF could reduce the
buffering for signals with high fanout. This may bring a smaller and
faster design.
And if you introduce pipelining, you could need more cycles for a
single operation, but get a better cycle/op ratio for the whole design
(Latency vs Throughput).

Just a few ideas why additional FF _could_ lead to faster and smaller
designs.

bye Thomas
 
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
DataGrid header style inconsistent with sortable column style cedoucette@alum.rpi.edu ASP .Net 0 10-14-2005 12:13 AM
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
Javascript Style Switcher that remebers current site style in use Hardeep Rakhra HTML 8 01-15-2004 08:00 PM
Style sheets, include one style within another (not inheritance) foldface@yahoo.co.uk HTML 1 11-24-2003 01:37 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