miércoles, 22 de abril de 2015

Simulacion de entrada de un dato para el Pmod AD1 nexys 3

module Simulacion_ADC_Instanciado;

// Inputs
reg clk100MHz;
reg reset;
reg datoADC;
reg inicio;

// Outputs
wire [15:0] dato_con_basura;
wire [11:0] dato_sin_basura;
wire listo;
wire CS;
wire clk44kHz;

// Instantiate the Unit Under Test (UUT)
ADC_DivisorFreq_Instanciado uut (
.clk100MHz(clk100MHz),
.reset(reset),
.datoADC(datoADC),
.inicio(inicio),
.dato_con_basura(dato_con_basura),
.dato_sin_basura(dato_sin_basura),
.listo(listo),
.CS(CS),
.clk44kHz(clk44kHz)
);

initial forever

#10 clk100MHz = ~clk100MHz;

initial begin
// Initialize Inputs
clk100MHz = 0;
reset = 0;
datoADC = 0;
inicio = 0;

#100000;

reset = 1;

#100000

reset = 0;

#100000

inicio = 1;

datoADC = 1; // bit basura    //Empezando con los MSBS
@(negedge clk44kHz)
datoADC = 1; // bit basura
      @(negedge clk44kHz)
datoADC = 1; // bit basura
@(negedge clk44kHz)
datoADC = 1; // bit basura
@(negedge clk44kHz)
datoADC = 0; // bit numero 12 del dato
@(negedge clk44kHz)
datoADC = 1; // bit numero 11 del dato
      @(negedge clk44kHz)
datoADC = 0; // bit numero 10 del dato
@(negedge clk44kHz)
datoADC = 1; // bit numero 9 del dato
@(negedge clk44kHz)
datoADC = 0; // bit numero 8 del dato
@(negedge clk44kHz)
datoADC = 1; // bit numero 7 del dato
      @(negedge clk44kHz)
datoADC = 0; // bit numero 6 del dato
@(negedge clk44kHz)
datoADC = 1; // bit numero 5 del dato
@(negedge clk44kHz)
datoADC = 0; //bit numero 4 del dato
@(negedge clk44kHz)
datoADC = 1; //bit numero 3 del dato
@(negedge clk44kHz)
datoADC = 0; //bit numero 2 del dato
@(negedge clk44kHz)
datoADC = 1; //bit numero 1 del dato
inicio = 0;
#100;
      repeat(10) @(posedge clk44kHz);
$stop;
end
endmodule

No hay comentarios:

Publicar un comentario