OpenCores
URL https://opencores.org/ocsvn/cavlc/cavlc/trunk

Subversion Repositories cavlc

[/] [cavlc/] [trunk/] [rtl/] [cavlc_fsm.v] - Diff between revs 6 and 7

Show entire file | Details | Blame | View Log

Rev 6 Rev 7
Line 1... Line 1...
 
//////////////////////////////////////////////////////////////////////
 
////                                                              ////
 
////  cavlc_fsm                                                   ////
 
////                                                              ////
 
////  Description                                                 ////
 
////      controls the cavlc parsing process                      ////
 
////                                                              ////
 
////  Author(s):                                                  ////
 
////      - bin qiu, qiubin@opencores.org                         ////
 
////                                                              ////
 
//////////////////////////////////////////////////////////////////////
 
////                                                              ////
 
//// Copyright (C) 2011 Authors and OPENCORES.ORG                 ////
 
////                                                              ////
 
//// This source file may be used and distributed without         ////
 
//// restriction provided that this copyright statement is not    ////
 
//// removed from the file and that any derivative work contains  ////
 
//// the original copyright notice and the associated disclaimer. ////
 
////                                                              ////
 
//// This source file is free software; you can redistribute it   ////
 
//// and/or modify it under the terms of the GNU Lesser General   ////
 
//// Public License as published by the Free Software Foundation; ////
 
//// either version 2.1 of the License, or (at your option) any   ////
 
//// later version.                                               ////
 
////                                                              ////
 
//// This source is distributed in the hope that it will be       ////
 
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
 
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
 
//// PURPOSE.  See the GNU Lesser General Public License for more ////
 
//// details.                                                     ////
 
////                                                              ////
 
//// You should have received a copy of the GNU Lesser General    ////
 
//// Public License along with this source; if not, download it   ////
 
//// from http://www.opencores.org/lgpl.shtml                     ////
 
////                                                              ////
 
//////////////////////////////////////////////////////////////////////
 
 
//2011-8-7 18:57        initial revision
//2011-8-7 18:57        initial revision
 
 
`include "defines.v"
`include "defines.v"
 
 
module cavlc_fsm
module cavlc_fsm
Line 48... Line 85...
 
 
//------------------------
//------------------------
//state & i & valid
//state & i & valid
//------------------------
//------------------------
always @(posedge clk or negedge rst_n)
always @(posedge clk or negedge rst_n)
if (~rst_n) begin
if (!rst_n) begin
        state   <= `cavlc_idle_s;
        state   <= `cavlc_idle_s;
        i <= 0;
        i <= 0;
        valid <= 0;
        valid <= 0;
end
end
else if (ena)
else if (ena)
Line 76... Line 113...
                        state <= `cavlc_idle_s;
                        state <= `cavlc_idle_s;
                        valid <= 1;
                        valid <= 1;
                end
                end
        end
        end
        `cavlc_read_t1s_flags_s : begin
        `cavlc_read_t1s_flags_s : begin
                if (TrailingOnes == TotalCoeff)         //TotalCoeff should not be larger than max_coeff_num
        if (TrailingOnes == TotalCoeff)
                        state <= `cavlc_read_total_zeros_s;
                        state <= `cavlc_read_total_zeros_s;
                else begin
                else begin
                        state <= `cavlc_read_level_prefix_s;
                        state <= `cavlc_read_level_prefix_s;
                        i <= i - TrailingOnes;
                        i <= i - TrailingOnes;
                end
                end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.