[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4834 - in gnuradio/branches/developers/thottelt: . tx
From: |
thottelt |
Subject: |
[Commit-gnuradio] r4834 - in gnuradio/branches/developers/thottelt: . tx_usb |
Date: |
Sat, 31 Mar 2007 18:16:47 -0600 (MDT) |
Author: thottelt
Date: 2007-03-31 18:16:46 -0600 (Sat, 31 Mar 2007)
New Revision: 4834
Added:
gnuradio/branches/developers/thottelt/tx_usb/
gnuradio/branches/developers/thottelt/tx_usb/tx_usb.cr.mti
gnuradio/branches/developers/thottelt/tx_usb/tx_usb.mpf
gnuradio/branches/developers/thottelt/tx_usb/tx_usb.v
gnuradio/branches/developers/thottelt/tx_usb/tx_usb_test.v
gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo.v
gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo_test.v
gnuradio/branches/developers/thottelt/tx_usb/vsim.wlf
Log:
tx_usb skeleton, need TESTING
Added: gnuradio/branches/developers/thottelt/tx_usb/tx_usb.cr.mti
===================================================================
--- gnuradio/branches/developers/thottelt/tx_usb/tx_usb.cr.mti
(rev 0)
+++ gnuradio/branches/developers/thottelt/tx_usb/tx_usb.cr.mti 2007-04-01
00:16:46 UTC (rev 4834)
@@ -0,0 +1,22 @@
+Z:/modelsim/tx_usb/tx_usb_test.v {1 {vlog -work work
Z:/modelsim/tx_usb/tx_usb_test.v
+Model Technology ModelSim ALTERA vlog 6.1g Compiler 2006.08 Aug 12 2006
+-- Compiling module tx_usb_buffer_test
+
+Top level modules:
+ tx_usb_buffer_test
+
+} {} {}} Z:/modelsim/tx_usb/usb_packet_fifo.v {1 {vlog -work work
Z:/modelsim/tx_usb/usb_packet_fifo.v
+Model Technology ModelSim ALTERA vlog 6.1g Compiler 2006.08 Aug 12 2006
+-- Compiling module usb_packet_fifo
+
+Top level modules:
+ usb_packet_fifo
+
+} {} {}} Z:/modelsim/tx_usb/usb_packet_fifo_test.v {1 {vlog -work work
Z:/modelsim/tx_usb/usb_packet_fifo_test.v
+Model Technology ModelSim ALTERA vlog 6.1g Compiler 2006.08 Aug 12 2006
+-- Compiling module usb_packet_fifo_test
+
+Top level modules:
+ usb_packet_fifo_test
+
+} {} {}}
Property changes on: gnuradio/branches/developers/thottelt/tx_usb/tx_usb.cr.mti
___________________________________________________________________
Name: svn:executable
+ *
Added: gnuradio/branches/developers/thottelt/tx_usb/tx_usb.mpf
===================================================================
--- gnuradio/branches/developers/thottelt/tx_usb/tx_usb.mpf
(rev 0)
+++ gnuradio/branches/developers/thottelt/tx_usb/tx_usb.mpf 2007-04-01
00:16:46 UTC (rev 4834)
@@ -0,0 +1,286 @@
+[Library]
+
+; Altera specific primitive library mappings
+
+vital2000 = $MODEL_TECH/../vital2000
+ieee = $MODEL_TECH/../ieee
+verilog = $MODEL_TECH/../verilog
+std = $MODEL_TECH/../std
+std_developerskit = $MODEL_TECH/../std_developerskit
+synopsys = $MODEL_TECH/../synopsys
+modelsim_lib = $MODEL_TECH/../modelsim_lib
+apex20k = $MODEL_TECH/../altera/vhdl/apex20k
+apex20ke = $MODEL_TECH/../altera/vhdl/apex20ke
+apexii = $MODEL_TECH/../altera/vhdl/apexii
+altera_mf = $MODEL_TECH/../altera/vhdl/altera_mf
+altera = $MODEL_TECH/../altera/vhdl/altera
+lpm = $MODEL_TECH/../altera/vhdl/220model
+220model = $MODEL_TECH/../altera/vhdl/220model
+alt_vtl = $MODEL_TECH/../altera/vhdl/alt_vtl
+flex6000 = $MODEL_TECH/../altera/vhdl/flex6000
+flex10ke = $MODEL_TECH/../altera/vhdl/flex10ke
+max = $MODEL_TECH/../altera/vhdl/max
+maxii = $MODEL_TECH/../altera/vhdl/maxii
+stratix = $MODEL_TECH/../altera/vhdl/stratix
+stratixii = $MODEL_TECH/../altera/vhdl/stratixii
+cyclone = $MODEL_TECH/../altera/vhdl/cyclone
+cycloneii = $MODEL_TECH/../altera/vhdl/cycloneii
+sgate = $MODEL_TECH/../altera/vhdl/sgate
+apex20k_ver = $MODEL_TECH/../altera/verilog/apex20k
+apex20ke_ver = $MODEL_TECH/../altera/verilog/apex20ke
+apexii_ver = $MODEL_TECH/../altera/verilog/apexii
+altera_mf_ver = $MODEL_TECH/../altera/verilog/altera_mf
+altera_ver = $MODEL_TECH/../altera/verilog/altera
+lpm_ver = $MODEL_TECH/../altera/verilog/220model
+220model_ver = $MODEL_TECH/../altera/verilog/220model
+alt_ver = $MODEL_TECH/../altera/verilog/alt_vtl
+flex6000_ver = $MODEL_TECH/../altera/verilog/flex6000
+flex10ke_ver = $MODEL_TECH/../altera/verilog/flex10ke
+max_ver = $MODEL_TECH/../altera/verilog/max
+maxii_ver = $MODEL_TECH/../altera/verilog/maxii
+stratix_ver = $MODEL_TECH/../altera/verilog/stratix
+stratixii_ver = $MODEL_TECH/../altera/verilog/stratixii
+cyclone_ver = $MODEL_TECH/../altera/verilog/cyclone
+cycloneii_ver = $MODEL_TECH/../altera/verilog/cycloneii
+sgate_ver = $MODEL_TECH/../altera/verilog/sgate
+stratixiii_ver = $MODEL_TECH/../altera/verilog/stratixiii
+stratixiii = $MODEL_TECH/../altera/vhdl/stratixiii
+
+work = work
+[vcom]
+; Turn on VHDL-1993 as the default. Normally is off.
+; VHDL93 = 1
+
+; Show source line containing error. Default is off.
+; Show_source = 1
+
+; Turn off unbound-component warnings. Default is on.
+; Show_Warning1 = 0
+
+; Turn off process-without-a-wait-statement warnings. Default is on.
+; Show_Warning2 = 0
+
+; Turn off null-range warnings. Default is on.
+; Show_Warning3 = 0
+
+; Turn off no-space-in-time-literal warnings. Default is on.
+; Show_Warning4 = 0
+
+; Turn off multiple-drivers-on-unresolved-signal warnings. Default is on.
+; Show_Warning5 = 0
+
+; Turn off optimization for IEEE std_logic_1164 package. Default is on.
+; Optimize_1164 = 0
+
+; Turn on resolving of ambiguous function overloading in favor of the
+; "explicit" function declaration (not the one automatically created by
+; the compiler for each type declaration). Default is off.
+; .ini file has Explict enable so that std_logic_signed/unsigned
+; will match synthesis tools behavior.
+ Explicit = 1
+
+; Turn off VITAL compliance checking. Default is checking on.
+; NoVitalCheck = 1
+
+; Ignore VITAL compliance checking errors. Default is to not ignore.
+; IgnoreVitalErrors = 1
+
+; Turn off VITAL compliance checking warnings. Default is to show warnings.
+; Show_VitalChecksWarnings = false
+
+; Turn off acceleration of the VITAL packages. Default is to accelerate.
+; NoVital = 1
+
+; Turn off inclusion of debugging info within design units. Default is to
include.
+; NoDebug = 1
+
+; Turn off "loading..." messages. Default is messages on.
+; Quiet = 1
+
+; Turn on some limited synthesis rule compliance checking. Checks only:
+; -- signals used (read) by a process must be in the sensitivity list
+; CheckSynthesis = 1
+
+; Require the user to specify a configuration for all bindings,
+; and do not generate a compile time default binding for the
+; component. This will result in an elaboration error of
+; 'component not bound' if the user fails to do so. Avoids the rare
+; issue of a false dependency upon the unused default binding.
+
+; RequireConfigForAllDefaultBinding = 1
+
+[vlog]
+
+; Turn off inclusion of debugging info within design units. Default is to
include.
+; NoDebug = 1
+
+; Turn off "loading..." messages. Default is messages on.
+; Quiet = 1
+
+; Turn on Verilog hazard checking (order-dependent accessing of global vars).
+; Default is off.
+; Hazard = 1
+
+; Turn on converting regular Verilog identifiers to uppercase. Allows case
+; insensitivity for module names. Default is no conversion.
+; UpCase = 1
+
+; Turns on incremental compilation of modules
+; Incremental = 1
+
+[vsim]
+; Simulator resolution
+; Set to fs, ps, ns, us, ms, or sec with optional prefix of 1, 10, or 100.
+resolution = 1ps
+
+; User time unit for run commands
+; Set to default, fs, ps, ns, us, ms, or sec. The default is to use the
+; unit specified for Resolution. For example, if Resolution is 100ps,
+; then UserTimeUnit defaults to ps.
+UserTimeUnit = default
+
+; Default run length
+RunLength = 100 ps
+
+; Maximum iterations that can be run without advancing simulation time
+IterationLimit = 5000
+
+; Directive to license manager:
+; vhdl Immediately reserve a VHDL license
+; vlog Immediately reserve a Verilog license
+; plus Immediately reserve a VHDL and Verilog license
+; nomgc Do not look for Mentor Graphics Licenses
+; nomti Do not look for Model Technology Licenses
+; noqueue Do not wait in the license queue when a license isn't available
+; License = plus
+
+; Stop the simulator after an assertion message
+; 0 = Note 1 = Warning 2 = Error 3 = Failure 4 = Fatal
+BreakOnAssertion = 3
+
+; Assertion Message Format
+; %S - Severity Level
+; %R - Report Message
+; %T - Time of assertion
+; %D - Delta
+; %I - Instance or Region pathname (if available)
+; %% - print '%' character
+; AssertionFormat = "** %S: %R\n Time: %T Iteration: %D%I\n"
+
+; Assertion File - alternate file for storing assertion messages
+; AssertFile = assert.log
+
+; Default radix for all windows and commands...
+; Set to symbolic, ascii, binary, octal, decimal, hex, unsigned
+DefaultRadix = symbolic
+
+; VSIM Startup command
+; Startup = do startup.do
+
+; File for saving command transcript
+TranscriptFile = transcript
+
+; File for saving command history
+;CommandHistory = cmdhist.log
+
+; Specify whether paths in simulator commands should be described
+; in VHDL or Verilog format. For VHDL, PathSeparator = /
+; for Verilog, PathSeparator = .
+PathSeparator = /
+
+; Specify the dataset separator for fully rooted contexts.
+; The default is ':'. For example, sim:/top
+; Must not be the same character as PathSeparator.
+DatasetSeparator = :
+
+; Disable assertion messages
+; IgnoreNote = 1
+; IgnoreWarning = 1
+; IgnoreError = 1
+; IgnoreFailure = 1
+
+; Default force kind. May be freeze, drive, or deposit
+; or in other terms, fixed, wired or charged.
+; DefaultForceKind = freeze
+
+; If zero, open files when elaborated
+; else open files on first read or write
+; DelayFileOpen = 0
+
+; Control VHDL files opened for write
+; 0 = Buffered, 1 = Unbuffered
+UnbufferedOutput = 0
+
+; Control number of VHDL files open concurrently
+; This number should always be less then the
+; current ulimit setting for max file descriptors
+; 0 = unlimited
+ConcurrentFileLimit = 40
+
+; This controls the number of hierarchical regions displayed as
+; part of a signal name shown in the waveform window. The default
+; value or a value of zero tells VSIM to display the full name.
+; WaveSignalNameWidth = 0
+
+; Turn off warnings from the std_logic_arith, std_logic_unsigned
+; and std_logic_signed packages.
+; StdArithNoWarnings = 1
+
+; Turn off warnings from the IEEE numeric_std and numeric_bit
+; packages.
+; NumericStdNoWarnings = 1
+
+; Control the format of a generate statement label. Don't quote it.
+; GenerateFormat = %s__%d
+
+; Specify whether checkpoint files should be compressed.
+; The default is to be compressed.
+; CheckpointCompressMode = 0
+
+; List of dynamically loaded objects for Verilog PLI applications
+; Veriuser = veriuser.sl
+[Project]
+Project_Version = 6
+Project_DefaultLib = work
+Project_SortMethod = unused
+Project_Files_Count = 4
+Project_File_0 = Z:/modelsim/tx_usb/tx_usb_test.v
+Project_File_P_0 = cover_toggle 0 vlog_protect 0 file_type verilog group_id 0
cover_exttoggle 0 cover_cond 0 vlog_nodebug 0 vlog_1995compat 0 folder {Top
Level} last_compile 1175381394 cover_branch 0 vlog_noload 0 vlog_enable0In 0
vlog_disableopt 0 vlog_vopt 0 vlog_hazard 0 vlog_showsource 0 ood 0
vlog_0InOptions {} vlog_options {} compile_to work vlog_upper 0 compile_order 3
dont_compile 0 cover_expr 0 cover_stmt 0
+Project_File_1 = Z:/modelsim/tx_usb/usb_packet_fifo.v
+Project_File_P_1 = cover_toggle 0 vlog_protect 0 file_type verilog group_id 0
cover_exttoggle 0 cover_cond 0 vlog_nodebug 0 vlog_1995compat 0 folder {Top
Level} last_compile 1175382084 cover_branch 0 vlog_noload 0 vlog_enable0In 0
vlog_disableopt 0 vlog_vopt 0 vlog_showsource 0 vlog_hazard 0 vlog_0InOptions
{} ood 0 vlog_upper 0 compile_to work vlog_options {} compile_order 2
cover_expr 0 dont_compile 0 cover_stmt 0
+Project_File_2 = Z:/modelsim/tx_usb/tx_usb.v
+Project_File_P_2 = cover_toggle 0 vlog_protect 0 file_type verilog group_id 0
cover_exttoggle 0 cover_cond 0 vlog_nodebug 0 vlog_1995compat 0 folder {Top
Level} last_compile 1175385931 cover_branch 0 vlog_noload 0 vlog_enable0In 0
vlog_disableopt 0 vlog_vopt 0 vlog_hazard 0 vlog_showsource 0 ood 0
vlog_0InOptions {} vlog_options {} compile_to work vlog_upper 0 compile_order 0
dont_compile 0 cover_expr 0 cover_stmt 0
+Project_File_3 = Z:/modelsim/tx_usb/usb_packet_fifo_test.v
+Project_File_P_3 = cover_toggle 0 vlog_protect 0 file_type verilog group_id 0
cover_exttoggle 0 cover_cond 0 vlog_nodebug 0 vlog_1995compat 0 folder {Top
Level} last_compile 1175295397 cover_branch 0 vlog_noload 0 vlog_enable0In 0
vlog_disableopt 0 vlog_vopt 0 vlog_showsource 0 vlog_hazard 0 vlog_0InOptions
{} ood 0 vlog_upper 0 compile_to work vlog_options {} compile_order 1
cover_expr 0 dont_compile 0 cover_stmt 0
+Project_Sim_Count = 0
+Project_Folder_Count = 0
+Echo_Compile_Output = 0
+Save_Compile_Report = 1
+Project_Opt_Count = 0
+ForceSoftPaths = 0
+ReOpenSourceFiles = 1
+VERILOG_DoubleClick = Edit
+VERILOG_CustomDoubleClick =
+VHDL_DoubleClick = Edit
+VHDL_CustomDoubleClick =
+PSL_DoubleClick = Edit
+PSL_CustomDoubleClick =
+TEXT_DoubleClick = Edit
+TEXT_CustomDoubleClick =
+SYSTEMC_DoubleClick = Edit
+SYSTEMC_CustomDoubleClick =
+TCL_DoubleClick = Edit
+TCL_CustomDoubleClick =
+MACRO_DoubleClick = Edit
+MACRO_CustomDoubleClick =
+VCD_DoubleClick = Edit
+VCD_CustomDoubleClick =
+SDF_DoubleClick = Edit
+SDF_CustomDoubleClick =
+XML_DoubleClick = Edit
+XML_CustomDoubleClick =
+LOGFILE_DoubleClick = Edit
+LOGFILE_CustomDoubleClick =
+EditorState = {tabbed horizontal 1} {Z:/modelsim/tx_usb/usb_packet_fifo_test.v
0 1}
+Project_Major_Version = 6
+Project_Minor_Version = 1
Property changes on: gnuradio/branches/developers/thottelt/tx_usb/tx_usb.mpf
___________________________________________________________________
Name: svn:executable
+ *
Added: gnuradio/branches/developers/thottelt/tx_usb/tx_usb.v
===================================================================
--- gnuradio/branches/developers/thottelt/tx_usb/tx_usb.v
(rev 0)
+++ gnuradio/branches/developers/thottelt/tx_usb/tx_usb.v 2007-04-01
00:16:46 UTC (rev 4834)
@@ -0,0 +1,119 @@
+module tx_usb_buffer (
+ input usb_clock,
+ input tx_clock,
+ input [15:0] usb_data,
+ input WR,
+ input reset,
+ output reg [15:0] tx_cmd_bus,
+ output reg [15:0] tx_chan_bus_0,
+ output reg [15:0] tx_chan_bus_1 ) ;
+
+ `define IDLE 3'd0
+ `define READ_TARGET 3'd1
+ `define READ_LENGTH 3'd2
+ `define FORWARD_DATA 3'd3
+ `define SKIP_REST 3'd4
+
+ reg [2:0] reader_state;
+ reg [2:0] reader_next_state;
+ wire [15:0] fifodata ;
+ reg [4:0] channel;
+ reg [8:0] pkt_length;
+ reg [8:0] read_length;
+ wire tx_full ;
+ reg rdreq;
+ reg skip;
+ wire pkt_waiting;
+
+ // FIFO
+ usb_packet_fifo tx_usb_fifo
+ ( .reset(reset),
+ .clock_in(usb_clock),
+ .clock_out(tx_clock),
+ .ram_data_in(usb_data),
+ .write_enable(WR),
+ .ram_data_out(fifodata),
+ .pkt_waiting(pkt_waiting),
+ .read_enable(rdreq),
+ .skip_packet(skip)
+ );
+
+
+ // Update the state
+ always @(posedge tx_clock)
+ begin
+ reader_state = reader_next_state;
+ end
+
+ // Read the fifo unless idle
+ always @(posedge pkt_waiting)
+ begin
+ rdreq <= pkt_waiting;
+ end
+
+ // FSM
+ always @(posedge tx_clock)
+ begin
+ if (reset) begin
+ reader_state <= `IDLE;
+ reader_next_state <= `IDLE;
+ rdreq <= 0;
+ end
+ else
+ case(reader_state)
+ `IDLE: begin
+ reader_next_state <= pkt_waiting ? `READ_TARGET : `IDLE;
+ skip <= 0;
+ end
+
+ `READ_TARGET: begin
+ reader_next_state <= `READ_LENGTH;
+ skip <= 0;
+ channel = (fifodata & 16'h1F);
+ case (channel)
+ 5'h0: tx_chan_bus_0 = fifodata;
+ 5'h1: tx_chan_bus_1 = fifodata;
+ 5'h1F: tx_cmd_bus = fifodata;
+ default: $display("No such channel");
+ endcase
+ end
+
+ `READ_LENGTH: begin
+ reader_next_state <= `FORWARD_DATA;
+ pkt_length <= fifodata & 16'h1FF;
+ read_length <= 9'd0;
+ case (channel)
+ 5'h0: tx_chan_bus_0 <= fifodata;
+ 5'h1: tx_chan_bus_1 <= fifodata;
+ 5'h1F: tx_cmd_bus <= fifodata;
+ default: $display("No such channel");
+ endcase
+ end
+
+ `FORWARD_DATA: begin
+ read_length <= read_length + 2;
+ if (read_length == pkt_length) begin
+ reader_next_state <= `SKIP_REST;
+ end
+ case (channel)
+ 5'h0: tx_chan_bus_0 <= fifodata;
+ 5'h1: tx_chan_bus_1 <= fifodata;
+ 5'h1F: tx_cmd_bus <= fifodata;
+ default: $display("No such channel");
+ endcase
+ end
+
+ `SKIP_REST: begin
+ reader_next_state <= pkt_waiting ? `READ_TARGET : `IDLE;
+ rdreq <= pkt_waiting ? 1 : 0;
+ skip <= 1;
+ end
+
+ default: $display("Error in reader_state");
+ endcase
+ end
+
+endmodule
+
+
+
\ No newline at end of file
Property changes on: gnuradio/branches/developers/thottelt/tx_usb/tx_usb.v
___________________________________________________________________
Name: svn:executable
+ *
Added: gnuradio/branches/developers/thottelt/tx_usb/tx_usb_test.v
===================================================================
--- gnuradio/branches/developers/thottelt/tx_usb/tx_usb_test.v
(rev 0)
+++ gnuradio/branches/developers/thottelt/tx_usb/tx_usb_test.v 2007-04-01
00:16:46 UTC (rev 4834)
@@ -0,0 +1,69 @@
+module tx_usb_buffer_test () ;
+
+//INPUTS
+reg usb_clock;
+reg tx_clock;
+reg [15:0] usb_data;
+reg WR;
+reg reset;
+
+//OUPUTS
+wire [15:0] tx_cmd;
+wire [15:0] tx_chan0;
+wire [15:0] tx_chan1;
+
+reg [15:0] i ;
+
+tx_usb_buffer test (
+ .reset(reset),
+ .usb_clock(usb_clock),
+ .WR(WR),
+ .tx_clock(tx_clock),
+ .tx_cmd_bus(tx_cmd),
+ .tx_chan_bus_0(tx_chan0),
+ .tx_chan_bus_1(tx_chan1),
+ .usb_data(usb_data)
+ );
+
+
+// Initialize Inputs
+ initial begin
+ // Setup the initial conditions
+ reset = 1;
+ usb_clock = 0;
+ usb_data = 0;
+ WR = 0;
+ tx_clock = 0;
+ i = 0 ;
+
+ // Deassert the reset
+ #40 reset = 1'b0 ;
+
+ // Wait a few clocks
+ repeat (5) begin
+ @(posedge usb_clock)
+ reset = 1'b0 ;
+ end
+
+ // Write an entire packets worth of data
+ // into the FIFO
+ repeat (512) begin
+ @(posedge usb_clock)
+ WR = 1'b1 ;
+ if (i == 1)
+ usb_data = 32;
+ else
+ usb_data = i ;
+ i = i + 1 ;
+ end
+ @(posedge usb_clock)
+ WR = 1'b0 ;
+ end
+
+always
+ #5 tx_clock = ~tx_clock ;
+
+always
+ #13 usb_clock = ~usb_clock ;
+
+endmodule
Property changes on: gnuradio/branches/developers/thottelt/tx_usb/tx_usb_test.v
___________________________________________________________________
Name: svn:executable
+ *
Added: gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo.v
===================================================================
--- gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo.v
(rev 0)
+++ gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo.v
2007-04-01 00:16:46 UTC (rev 4834)
@@ -0,0 +1,80 @@
+module usb_packet_fifo
+ ( input reset,
+ input clock_in,
+ input clock_out,
+ input [15:0]ram_data_in,
+ input write_enable,
+ output reg [15:0]ram_data_out,
+ output pkt_waiting,
+ input read_enable,
+ input skip_packet ) ;
+
+ /* Some parameters for usage later on */
+ parameter DATA_WIDTH = 16 ;
+ parameter NUM_PACKETS = 4 ;
+
+ /* Create the RAM here */
+ reg [DATA_WIDTH-1:0] usb_ram [512*NUM_PACKETS-1:0] ;
+
+ /* Create the address signals */
+ reg [8-2+NUM_PACKETS:0] usb_ram_ain ;
+ reg [8:0] usb_ram_offset ;
+ reg [1:0] usb_ram_packet ;
+
+ wire [8-2+NUM_PACKETS:0] usb_ram_aout ;
+
+ assign usb_ram_aout = {usb_ram_packet,usb_ram_offset} ;
+ assign pkt_waiting = ((usb_ram_ain - usb_ram_aout) >= 512) ? 1 : 0;
+
+ /* RAM Write Address process */
+ always @(posedge clock_in)
+ begin
+ if( reset )
+ usb_ram_ain <= 0 ;
+ else
+ if( write_enable )
+ begin
+ usb_ram_ain <= usb_ram_ain + 1 ;
+ end
+ end
+
+ /* RAM Writing process */
+ always @(posedge clock_in)
+ begin
+ if( write_enable )
+ begin
+ usb_ram[usb_ram_ain] <= ram_data_in ;
+ end
+ end
+
+ /* RAM Read Address process */
+ always @(posedge clock_out)
+ begin
+ if( reset )
+ begin
+ usb_ram_packet <= 0 ;
+ usb_ram_offset <= 0 ;
+ end
+ else
+ if( skip_packet )
+ begin
+ usb_ram_packet <= usb_ram_packet + 1 ;
+ usb_ram_offset <= 0 ;
+ end
+ else if(read_enable)
+ if( usb_ram_offset == 9'b111111111 )
+ begin
+ usb_ram_offset <= 0 ;
+ usb_ram_packet <= usb_ram_packet + 1 ;
+ end
+ else
+ usb_ram_offset <= usb_ram_offset + 1 ;
+ end
+
+ /* RAM Reading Process */
+ always @(posedge clock_out)
+ begin
+ ram_data_out <= usb_ram[usb_ram_aout] ;
+ end
+
+endmodule
\ No newline at end of file
Property changes on:
gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo.v
___________________________________________________________________
Name: svn:executable
+ *
Added: gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo_test.v
===================================================================
--- gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo_test.v
(rev 0)
+++ gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo_test.v
2007-04-01 00:16:46 UTC (rev 4834)
@@ -0,0 +1,89 @@
+module usb_packet_fifo_test() ;
+
+ // Inputs
+ reg reset;
+ reg clock_in;
+ reg [15:0] ram_data_in;
+ reg write_enable;
+ reg clock_out;
+ reg read_enable;
+ reg skip_packet;
+
+ reg [15:0] i ;
+
+
+ // Outputs
+ wire [15:0] ram_data_out;
+ wire is_packet;
+
+ // Instantiate the UUT
+ usb_packet_fifo uut (
+ .reset(reset),
+ .clock_in(clock_in),
+ .ram_data_in(ram_data_in),
+ .write_enable(write_enable),
+ .clock_out(clock_out),
+ .ram_data_out(ram_data_out),
+ .pkt_waiting(is_packet),
+ .read_enable(read_enable),
+ .skip_packet(skip_packet)
+ );
+
+
+ // Initialize Inputs
+ initial begin
+ // Setup the initial conditions
+ reset = 1;
+ clock_in = 0;
+ ram_data_in = 0;
+ write_enable = 0;
+ clock_out = 0;
+ read_enable = 0;
+ skip_packet = 0;
+ i = 0 ;
+
+ // Deassert the reset
+ #40 reset = 1'b0 ;
+
+ // Wait a few clocks
+ repeat (5) begin
+ @(posedge clock_in)
+ reset = 1'b0 ;
+ end
+
+ // Write an entire packets worth of data
+ // into the FIFO
+ repeat (512) begin
+ @(posedge clock_in)
+ write_enable = 1'b1 ;
+ ram_data_in = i ;
+ i = i + 1 ;
+ end
+ @(posedge clock_in)
+ write_enable = 1'b0 ;
+
+ // Only read the first 10 bytes of data
+ repeat (10) begin
+ @(posedge clock_out)
+ read_enable = 1'b1 ;
+ end
+ @(posedge clock_out)
+ read_enable = 1'b0 ;
+
+ // Skip the rest of the packet
+ @(posedge clock_out)
+ skip_packet = 1'b1 ;
+ @(posedge clock_out)
+ skip_packet = 1'b0 ;
+
+ end
+
+ always
+ #5 clock_in = ~clock_in ;
+
+ always
+ #13 clock_out = ~clock_out ;
+
+
+endmodule
+
Property changes on:
gnuradio/branches/developers/thottelt/tx_usb/usb_packet_fifo_test.v
___________________________________________________________________
Name: svn:executable
+ *
Added: gnuradio/branches/developers/thottelt/tx_usb/vsim.wlf
===================================================================
(Binary files differ)
Property changes on: gnuradio/branches/developers/thottelt/tx_usb/vsim.wlf
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4834 - in gnuradio/branches/developers/thottelt: . tx_usb,
thottelt <=