VHDL question (what is the better architecture for this desi

Guest
I'm learning VHDL then may be my question should be easy for you but I
need some hint to
go on the subject. At now I've to code a VHDL circut able to drive a
74HC595 register trough a four lines interface.
Here below the line signal used to drive the 74HC595 ic.

1. SSCLR
2. SSDAT
3. SSCLK
4. SSSTR

SSCLR will be used to clear the internal 74HC595 register
SSDAT used as data line, I've to put one bit each clock toggle
SSCLK clock for the internal 74HC595 shift registers
SSSTR strobe, used to load the data from the internal registers on the
output

At now I'm doing all the task with a microcontroller and I like to do
the same trough a dedicated logic circuit, from a logic flux point of
view I've to implement these steps:

dataword = 1;
For (i=0; i<=15; i++)
{

SSCLR <= 0;
wait;
SSCLR <= 1;
For (j=0; j<15;j++)
{
SSDAT <= dataword[j];
wait;
SSCLK <= 1;
wait;
SSCLK <= 0;
wait;
}
SSSTR <= 1;
SSSTR <= 0;
dataword << 1;
}

With this circuit I can load the parallel output of the 74HC595 with a
word builded with just only one bit to 1 in order to test all the
output.
My question is about what architecture is the best to use, a PROCESS
architecure might be useful in this way? As I've read a PROCESS is a
collection of statements that are processed in sequential way, but
also I've see that signals are updated on the process exit but into
this situation I've to update signal in real time to achieve the
right
behaviour. I'm are right or not about this point?

Thanks to all
Powermos
 
flatiron@libero.it wrote:

My question is about what architecture is the best to use, a PROCESS
architecture might be useful in this way?
There is no other way.

An architecture without a process does nothing.
For synthesis I use a clocked process like this:
--------------------------------------------------------------
architecture synth of my_entity is
begin
main : process(reset, clock) is
-- declarations here
begin -- process template
if reset = '1' then
init_regs; -- procedure call
elsif rising_edge(clock) then
update_regs; -- procedure call
end if;
update_ports; -- procedure call
end process main;
end architecture synth;
--------------------------------------------------------------
For simulation I use an unclocked process like this example ...

main : process is
-- procedure declarations here
constant reps : natural := 8;
begin -- process main: Top level loop invokes top procedures.
init;
for i in 1 to reps loop
timed_cycle; -- procedure call
end loop;
for i in 1 to reps loop
handshake_cycle; -- procedure call
end loop;
coda;
end process main;

.... based on procedures like this
--------------------------------------------------------------
procedure tic is
begin
wait until rising_edge(clk_s);
end procedure tic;
--------------------------------------------------------------
procedure set_bit (signal arg_s : inout std_ulogic) is
begin-- skip tic if already set
if arg_s /= '1' then
arg_s <= '1';
tic;
end if;
end procedure set_bit;
--------------------------------------------------------------
details here: http://mysite.verizon.net/miketreseler/

-- Mike Treseler
 
flatiron@libero.it wrote:
I'm learning VHDL then may be my question should be easy for you but I
need some hint to
go on the subject. At now I've to code a VHDL circut able to drive a
74HC595 register trough a four lines interface.
Here below the line signal used to drive the 74HC595 ic.

1. SSCLR
2. SSDAT
3. SSCLK
4. SSSTR

SSCLR will be used to clear the internal 74HC595 register
SSDAT used as data line, I've to put one bit each clock toggle
SSCLK clock for the internal 74HC595 shift registers
SSSTR strobe, used to load the data from the internal registers on the
output

At now I'm doing all the task with a microcontroller and I like to do
the same trough a dedicated logic circuit, from a logic flux point of
view I've to implement these steps:

dataword = 1;
For (i=0; i<=15; i++)
{

SSCLR <= 0;
wait;
SSCLR <= 1;
For (j=0; j<15;j++)
{
SSDAT <= dataword[j];
wait;
SSCLK <= 1;
wait;
SSCLK <= 0;
wait;
}
SSSTR <= 1;
SSSTR <= 0;
dataword << 1;
}

With this circuit I can load the parallel output of the 74HC595 with a
word builded with just only one bit to 1 in order to test all the
output.
My question is about what architecture is the best to use, a PROCESS
architecure might be useful in this way? As I've read a PROCESS is a
collection of statements that are processed in sequential way, but
also I've see that signals are updated on the process exit but into
this situation I've to update signal in real time to achieve the
right
behaviour. I'm are right or not about this point?

Thanks to all
Powermos
Just transcribing your code of above into a vhdl process will work for
simulation, but will not be synthesizable. AFAIK no synthesizer will
generate hardware from a process with multiple wait statements.
Synthesizable VHDL only contains processes that wait on a clock (for
modeling synchronous logic) or with no wait statements or clock edge
sensing (for combinatorial logic).

To generate synthesizable hardware you should think of the design in
terms of flip flops, combinatorial logic, hardware state machines and so
forth. All synchronous elements run from a common clock. Your task could
be implemented with a simple state machine. See:

http://en.wikipedia.org/wiki/Register_transfer_level
http://en.wikipedia.org/wiki/State_machine

-Jeff
 
Dear Mike,
thank you for your reply.
Well If I've correctly understand I can use the PROCESS architecture
also to update immediatly the output signals (as into the concurrent
statements), following your example I've to build a first section like
this one:

-----------------------------------
architecture synth of my_entity is
begin
main : process(reset, clock) is
-- declarations here
begin -- process template
if reset = '1' then
init_regs; -- procedure call
elsif rising_edge(clock) then
update_regs; -- procedure call
end if;
update_ports; -- procedure call
end process main;
end architecture synth;
-----------------------------------

in this way when the reset signal is set to 1 at every clock pulse the
update_regs procedure will be called, this procedure should be used to
update the internal registers (FSM) or other stuff then, before the
main process exit, I can update the output signals by using the
update_ports procedure. Of course, if I'm right, the update_regs and
update_ports procedure can be written with concurrent signals
assegnation or should be implemented as PROCESS itself or a mixed of
this type.

I've understanded the point?

Thanks
Powermos
 
On 8 Lug, 16:14, Mike Treseler <mtrese...@gmail.com> wrote:
flati...@libero.it wrote:
My question is about what architecture is the best to use, a PROCESS
architecture might be useful in this way?

There is no other way.

An architecture without a process does nothing.
For synthesis I use a clocked process like this:
[CUT]

Dear Mike,
thank you for your reply.
Well If I've correctly understand I can use the PROCESS architecture
also to update immediatly the output signals (as into the concurrent
statements), following your example I've to build a first section like
this one:

-----------------------------------
architecture synth of my_entity is
begin
main : process(reset, clock) is
-- declarations here
begin -- process template
if reset = '1' then
init_regs; -- procedure call
elsif rising_edge(clock) then
update_regs; -- procedure call
end if;
update_ports; -- procedure call
end process main;
end architecture synth;
-----------------------------------

in this way when the reset signal is set to 1 at every clock pulse the
update_regs procedure will be called, this procedure should be used to
update the internal registers (FSM) or other stuff then, before the
main process exit, I can update the output signals by using the
update_ports procedure. Of course, if I'm right, the update_regs and
update_ports procedure can be written with concurrent signals
assegnation or should be implemented as PROCESS itself or a mixed of
this type.

I've understanded the point?

Thanks
Powermos
 
flatiron@libero.it wrote:

in this way when the reset signal is set to 1 at every clock pulse
Reset is an input that normally happens at power up.

I've understanded the point?
I don't think so. Consider hiring a local tutor.

-- Mike Treseler
 
weber wrote:

Why do you write two versions of the same code? Speed up simulations?
I use the first for synthesis, the second for simulation.

-- Mike Treseler
 
On Jul 8, 11:14 am, Mike Treseler <mtrese...@gmail.com> wrote:
flati...@libero.it wrote:
My question is about what architecture is the best to use, a PROCESS
architecture might be useful in this way?

There is no other way.

An architecture without a process does nothing.
For synthesis I use a clocked process like this:
--------------------------------------------------------------
architecture synth of my_entity is
begin
    main : process(reset, clock) is
    -- declarations here
    begin  -- process template
       if reset = '1' then
          init_regs;    -- procedure call
       elsif rising_edge(clock) then
          update_regs;  -- procedure call
       end if;
       update_ports;    -- procedure call
    end process main;
end architecture synth;
--------------------------------------------------------------
For simulation I use an unclocked process like this example ...

    main : process is
       -- procedure declarations here
       constant reps : natural := 8;
    begin  -- process main: Top level loop invokes top procedures.
       init;
       for i in 1 to reps loop
          timed_cycle;     -- procedure call
       end loop;
       for i in 1 to reps loop
          handshake_cycle; -- procedure call
       end loop;
       coda;
    end process main;

... based on procedures like this
--------------------------------------------------------------
       procedure tic is
       begin
          wait until rising_edge(clk_s);
       end procedure tic;
--------------------------------------------------------------
       procedure set_bit (signal arg_s : inout std_ulogic) is
       begin-- skip tic if already set
          if arg_s /= '1' then
             arg_s <= '1';
             tic;
          end if;
       end procedure set_bit;
--------------------------------------------------------------
details here:http://mysite.verizon.net/miketreseler/

        -- Mike Treseler
Why do you write two versions of the same code? Speed up simulations?
-weber
 
Just transcribing your code of above into a vhdl process will work for
simulation, but will not be synthesizable. AFAIK no synthesizer will
generate hardware from a process with multiple wait statements.
Synthesizable VHDL only contains processes that wait on a clock (for
modeling synchronous logic) or with no wait statements or clock edge
sensing (for combinatorial logic).

To generate synthesizable hardware you should think of the design in
terms of flip flops, combinatorial logic, hardware state machines and so
forth. All synchronous elements run from a common clock. Your task could
be implemented with a simple state machine. See:

http://en.wikipedia.org/wiki/Register_transfer_levelhttp://en.wikipedia.org/wiki/State_machine

-Jeff- Nascondi testo citato
Dear Jeff,
thanks to have point it, my first example is just a flow that I've
from my original code implemented into the microcontroller.

Bye
Powermos
 

Welcome to EDABoard.com

Sponsor

Back
Top