La presentazione è in caricamento. Aspetta per favore

La presentazione è in caricamento. Aspetta per favore

Disegni organizzati gerarchicamente Ciascun elemento del disegno ha: –Uninterfaccia ben definita –Una precisa specifica del comportamento usando o: Una.

Presentazioni simili


Presentazione sul tema: "Disegni organizzati gerarchicamente Ciascun elemento del disegno ha: –Uninterfaccia ben definita –Una precisa specifica del comportamento usando o: Una."— Transcript della presentazione:

1

2 Disegni organizzati gerarchicamente Ciascun elemento del disegno ha: –Uninterfaccia ben definita –Una precisa specifica del comportamento usando o: Una descrizione algoritmica Una descrizione strutturale dellhardware Modella la concorrenza, la temporizzazione, e il clock: –Gestisce circuiti asincroni e sincroni –I disegni possono essere simulati VERILOG HDL (Hardware Description Language)

3 macchina a stati semaforo in verilog module sm_DAC(); Dichiarazione varibili … Funzionalità endmodule; module sm_DAC(res,clk,start_DAC,Cout, CNT_EN,CNT_RES,DAC_CLK,LOAD); Dichiarazione varibili … Funzionalità endmodule; Il blocco costruttivo fondamentale di verilog è il modulo Start_DAC clk res CNT_EN DAC_CLK SM_DAC CNT_RES CoutLOAD

4 Dichiarazione dei segnali: segnali di input module sm_DAC( res,clk,start_DAC,Cout, CNT_EN,CNT_RES,DAC_CLK,LOAD); input res, clk, start_DAC, Cout; … Funzionalità endmodule; Il blocco costruttivo fondamentale di verilog è il modulo Start_DAC clk res CNT_EN DAC_CLK SM_DAC CNT_RES Cout LOAD

5 Dichiarazione dei segnali: segnali di output module sm_DAC( res,clk,start_DAC,Cout, CNT_EN,CNT_RES,DAC_CLK,LOAD); input res, clk, start_DAC, Cout; output CNT_EN, CNT_RES, DAC_CLK, LOAD; reg CNT_EN, CNT_RES, DAC_CLK, LOAD; Funzionalità endmodule; Start_DAC clk res CNT_EN DAC_CLK SM_DAC CNT_RES Cout LOAD

6 Definizione degli stati module sm_DAC( res,clk,Start_DAC,Cout, CNT_EN,CNT_RES,DAC_CLK,LOAD); input res, clk, start_DAC, Cout; output CNT_EN, CNT_RES, DAC_CLK, LOAD; reg CNT_EN, CNT_RES, DAC_CLK, LOAD; reg [1:0] state; parameter idle = 2'b00; parameter S0 = 2'b01; parameter S1 = 2b10; Parameter S2 = 2b11; Funzionalità endmodule;

7 Le transizioni degli stati module sm_DAC( res,clk,Start_DAC,Cout, CNT_EN,CNT_RES,DAC_CLK, LOAD); input res, clk, start_DAC, Cout; output CNT_EN, CNT_RES, DAC_CLK, LOAD; reg CNT_EN, CNT_RES, DAC_CLK, LOAD; reg [1:0] state; parameter idle = 2'b00; parameter S0 = 2'b01; parameter S1 = 2b10; Parameter S2 = 2b11; always @ (posedge clk or negedge reset) begin if (reset == 0) state = idle; else … end endmodule;

8 Statement always always @(condizione) begin … end Ogni volta che è soddisfatta la condizione in parentesi, vengono eseguiti tutti gli stament contenuti allinterno del blocco begin-end Blocco begin-end: analogo a un raggruppamento di istruzioni {} del linguaggio di programmazione C. state=idle è eseguito ogni volta che il segnale res compie una transizione negativa Altrimenti su ogni bordo positivo di clk... always @(posedge clk or negedge res) begin if(reset == 0) state=idle else …

9 always @ (posedge clk or negedge reset) begin if (reset == 0) state = idle; else case (state) idle: if(start_DAC == 1) state = S0; else state = idle; S0: state = S1; S1: if(Cout == 1) state = S2; else state = S0; S2: state = idle; endcase end

10 La definizione dei segnali di output always @ (state) begin case (state) idle: begin CNT_EN= 0; CNT_RES = 1; DAC_CLK = 0; LOAD = 1; end S0: begin CNT_EN= 1; CNT_RES = 1; DAC_CLK = 1; LOAD = 1; end S1: begin CNT_EN= 0; CNT_RES = 1; DAC_CLK = 0; LOAD = 1; end S2: begin CNT_EN= 0; CNT_RES = 0; DAC_CLK = 0; LOAD = 0; end endcase end

11 La definizione dei segnali di output always @ (state) begin case (state) idle: begin CNT_EN= 0; CNT_RES = 1; DAC_CLK = 0; LOAD = 1; end S0: begin CNT_EN= 1; CNT_RES = 1; DAC_CLK = 1; LOAD = 1; end S1: begin CNT_EN= 0; CNT_RES = 1; DAC_CLK = 0; LOAD = 1; end S2: begin CNT_EN= 0; CNT_RES = 0; DAC_CLK = 0; LOAD = 0; end endcase end


Scaricare ppt "Disegni organizzati gerarchicamente Ciascun elemento del disegno ha: –Uninterfaccia ben definita –Una precisa specifica del comportamento usando o: Una."

Presentazioni simili


Annunci Google