diff options
author | Mohamed Abdelnour <mohamed.k.abdelnour@gmail.com> | 2021-05-30 10:49:43 +0200 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2021-06-01 22:36:56 +0200 |
commit | c18afcb01a2bd6561381d4bd301a3cb1fcd5d5f8 (patch) | |
tree | c17e93f28dde1bc8215a8f210f8bb7b7b4eb15a0 /tests | |
parent | 63043d4a60d21c6e0c4a2520827a2ba07077b3a1 (diff) |
Add Verilog syntax test file
Diffstat (limited to 'tests')
-rw-r--r-- | tests/syntax-tests/highlighted/Verilog/div_pipelined.v | 172 | ||||
-rw-r--r-- | tests/syntax-tests/source/Verilog/LICENSE.md | 205 | ||||
-rw-r--r-- | tests/syntax-tests/source/Verilog/div_pipelined.v | 172 |
3 files changed, 549 insertions, 0 deletions
diff --git a/tests/syntax-tests/highlighted/Verilog/div_pipelined.v b/tests/syntax-tests/highlighted/Verilog/div_pipelined.v new file mode 100644 index 00000000..81a7c96a --- /dev/null +++ b/tests/syntax-tests/highlighted/Verilog/div_pipelined.v @@ -0,0 +1,172 @@ +[38;2;117;113;94m//[0m[38;2;117;113;94m Copyright 2018 Schuyler Eldridge[0m +[38;2;117;113;94m//[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m Licensed under the Apache License, Version 2.0 (the "License");[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m you may not use this file except in compliance with the License.[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m You may obtain a copy of the License at[0m +[38;2;117;113;94m//[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m http://www.apache.org/licenses/LICENSE-2.0[0m +[38;2;117;113;94m//[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m Unless required by applicable law or agreed to in writing, software[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m distributed under the License is distributed on an "AS IS" BASIS,[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m See the License for the specific language governing permissions and[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m limitations under the License.[0m + +[38;2;117;113;94m//[0m[38;2;117;113;94m Implements a fixed-point parameterized pipelined division[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m operation. Outputs are expected to be on range [-1,1), techincally[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m [-1,2^(BITS-1)-1/2^(BITS-1)]. There is no convergent rounding.[0m +[38;2;117;113;94m//[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m [TODO] Implement optional convergent rounding and some form of[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m variable output binary point placement. There are arguments in[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m these changes that make sense (specifically, adding an additional[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m bit results in a gain of one value when all the other 2^6 values[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m greater than 1 aren't used). Other improvements that are needed: 1)[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m quotient_gen is getting smaller by one bit in every stage, it would[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m make more sense to generate this as such, 2) there's some weird[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m initial behavior after rst_n is deasserted, you get weird output on[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m the quotient line for a number of cycles.[0m +[38;2;117;113;94m//[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m [TODO] This doesn't exactly behave as expected if you specify[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m different BITS and STAGES parameters (which for a functional[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m module, should be implemented). Note, that this technically works,[0m +[38;2;117;113;94m//[0m[38;2;117;113;94m but needs more investigation to fully understand its properties.[0m + +[38;2;190;132;255m`timescale[0m[38;2;248;248;242m 1ns [0m[38;2;249;38;114m/[0m[38;2;248;248;242m 1ps[0m +[3;38;2;102;217;239mmodule[0m[38;2;248;248;242m [0m[38;2;166;226;46mdiv_pipelined[0m +[38;2;248;248;242m [0m[38;2;249;38;114m([0m +[38;2;248;248;242m [0m[3;38;2;166;226;46minput[0m[38;2;248;248;242m clk[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46minput[0m[38;2;248;248;242m rst_n[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46minput[0m[38;2;248;248;242m start[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46minput[0m[38;2;248;248;242m [0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m dividend[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46minput[0m[38;2;248;248;242m [0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m divisor[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46moutput[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mreg[0m[38;2;248;248;242m data_valid[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46moutput[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mreg[0m[38;2;248;248;242m div_by_zero[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m [0m[3;38;2;166;226;46moutput[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mreg[0m[38;2;248;248;242m [0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m quotient[0m +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m output reg [7:0] quotient_correct[0m +[38;2;248;248;242m [0m[38;2;249;38;114m)[0m[38;2;249;38;114m;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m WARNING!!! THESE PARAMETERS ARE INTENDED TO BE MODIFIED IN A TOP[0m +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m LEVEL MODULE. LOCAL CHANGES HERE WILL, MOST LIKELY, BE[0m +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m OVERWRITTEN![0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mparameter[0m +[38;2;248;248;242m BITS [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m8[0m[38;2;249;38;114m,[0m +[38;2;248;248;242m STAGES [0m[38;2;249;38;114m=[0m[38;2;248;248;242m BITS[0m[38;2;249;38;114m;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m y = a/bQ[0m + +[38;2;248;248;242m [0m[3;38;2;102;217;239mreg[0m[38;2;248;248;242m [0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m start_gen[0m[38;2;249;38;114m,[0m[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m,[0m[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mreg[0m[38;2;248;248;242m [0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m,[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m,[0m[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mwire[0m[38;2;248;248;242m [0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m pad_dividend[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mwire[0m[38;2;248;248;242m [0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m pad_divisor[0m[38;2;249;38;114m;[0m + +[38;2;248;248;242m [0m[38;2;249;38;114massign[0m[38;2;248;248;242m pad_dividend [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114massign[0m[38;2;248;248;242m pad_divisor [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m sign conversion stage[0m +[38;2;248;248;242m [0m[38;2;249;38;114malways[0m[38;2;248;248;242m [0m[38;2;249;38;114m@[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114mposedge[0m[38;2;248;248;242m clk [0m[3;38;2;166;226;46mor[0m[38;2;248;248;242m [0m[38;2;249;38;114mnegedge[0m[38;2;248;248;242m rst_n[0m[38;2;249;38;114m)[0m +[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114m![0m[38;2;248;248;242mrst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mdivisor [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m)[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m start[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m dividend[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m^[0m[38;2;248;248;242m divisor[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mdividend[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m?[0m[38;2;248;248;242m [0m[38;2;249;38;114m~[0m[38;2;249;38;114m{[0m[38;2;248;248;242mdividend[0m[38;2;249;38;114m,[0m[38;2;248;248;242mpad_dividend[0m[38;2;249;38;114m}[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;249;38;114m{[0m[38;2;248;248;242mdividend[0m[38;2;249;38;114m,[0m[38;2;248;248;242mpad_dividend[0m[38;2;249;38;114m}[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mdivisor [0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m?[0m[38;2;248;248;242m [0m[38;2;249;38;114m~[0m[38;2;249;38;114m{[0m[38;2;190;132;255m1'b1[0m[38;2;249;38;114m,[0m[38;2;248;248;242mdivisor[0m[38;2;249;38;114m,[0m[38;2;248;248;242m pad_divisor[0m[38;2;249;38;114m}[0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m [0m[38;2;249;38;114m{[0m[38;2;190;132;255m1'b0[0m[38;2;249;38;114m,[0m[38;2;248;248;242mdivisor[0m[38;2;249;38;114m,[0m[38;2;248;248;242m pad_divisor[0m[38;2;249;38;114m}[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m first computation stage[0m +[38;2;248;248;242m [0m[38;2;249;38;114malways[0m[38;2;248;248;242m [0m[38;2;249;38;114m@[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114mposedge[0m[38;2;248;248;242m clk [0m[3;38;2;166;226;46mor[0m[38;2;248;248;242m [0m[38;2;249;38;114mnegedge[0m[38;2;248;248;242m rst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114m![0m[38;2;248;248;242mrst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m>[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m>=[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114m<[0m[38;2;249;38;114m<[0m[38;2;248;248;242m STAGES [0m[38;2;249;38;114m-[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;190;132;255m0[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m else: !if(!rst_n)[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m always @ (posedge clk)[0m + +[38;2;248;248;242m [0m[38;2;249;38;114mgenerate[0m +[38;2;248;248;242m [0m[38;2;249;38;114mgenvar[0m[38;2;248;248;242m i[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mi [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m;[0m[38;2;248;248;242m i [0m[38;2;249;38;114m<[0m[38;2;248;248;242m STAGES [0m[38;2;249;38;114m-[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;249;38;114m;[0m[38;2;248;248;242m i [0m[38;2;249;38;114m=[0m[38;2;248;248;242m i [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m pipeline[0m +[38;2;248;248;242m [0m[38;2;249;38;114malways[0m[38;2;248;248;242m [0m[38;2;249;38;114m@[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114mposedge[0m[38;2;248;248;242m clk [0m[3;38;2;166;226;46mor[0m[38;2;248;248;242m [0m[38;2;249;38;114mnegedge[0m[38;2;248;248;242m rst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114m![0m[38;2;248;248;242mrst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m>[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mdividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m>=[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114m<[0m[38;2;249;38;114m<[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m-[0m[38;2;248;248;242mi[0m[38;2;249;38;114m)[0m[38;2;249;38;114m)[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m-[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mi[0m[38;2;249;38;114m+[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;248;248;242mi[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m else: !if(!rst_n)[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m always @ (posedge clk or negedge rst_n)[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m block: pipeline[0m +[38;2;248;248;242m [0m[38;2;249;38;114mendgenerate[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m last computation stage[0m +[38;2;248;248;242m [0m[38;2;249;38;114malways[0m[38;2;248;248;242m [0m[38;2;249;38;114m@[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114mposedge[0m[38;2;248;248;242m clk [0m[3;38;2;166;226;46mor[0m[38;2;248;248;242m [0m[38;2;249;38;114mnegedge[0m[38;2;248;248;242m rst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114m![0m[38;2;248;248;242mrst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m negative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242m dividend_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m>=[0m[38;2;248;248;242m divisor_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m)[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m3[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m|[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m +[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m3[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m else: !if(!rst_n)[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m always @ (posedge clk)[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m sign conversion stage[0m +[38;2;248;248;242m [0m[38;2;249;38;114malways[0m[38;2;248;248;242m [0m[38;2;249;38;114m@[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114mposedge[0m[38;2;248;248;242m clk [0m[3;38;2;166;226;46mor[0m[38;2;248;248;242m [0m[38;2;249;38;114mnegedge[0m[38;2;248;248;242m rst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m [0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;249;38;114m![0m[38;2;248;248;242mrst_n[0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m data_valid [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m quotient [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114mbegin[0m +[38;2;248;248;242m div_by_zero [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m div_by_zero_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m data_valid [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m start_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m quotient [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;249;38;114m([0m[38;2;248;248;242mnegative_quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m][0m[38;2;249;38;114m)[0m[38;2;248;248;242m [0m[38;2;249;38;114m?[0m[38;2;248;248;242m [0m[38;2;249;38;114m~[0m[38;2;248;248;242mquotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;248;248;242m [0m[38;2;249;38;114m+[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114m:[0m[38;2;248;248;242m quotient_gen[0m[38;2;249;38;114m[[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m)[0m[38;2;249;38;114m-[0m[38;2;190;132;255m1[0m[38;2;249;38;114m:[0m[38;2;248;248;242mBITS[0m[38;2;249;38;114m*[0m[38;2;190;132;255m2[0m[38;2;249;38;114m*[0m[38;2;249;38;114m([0m[38;2;248;248;242mSTAGES[0m[38;2;249;38;114m-[0m[38;2;190;132;255m2[0m[38;2;249;38;114m)[0m[38;2;249;38;114m][0m[38;2;249;38;114m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m +[38;2;248;248;242m [0m[38;2;249;38;114mend[0m + +[3;38;2;102;217;239mendmodule[0m diff --git a/tests/syntax-tests/source/Verilog/LICENSE.md b/tests/syntax-tests/source/Verilog/LICENSE.md new file mode 100644 index 00000000..d097da11 --- /dev/null +++ b/tests/syntax-tests/source/Verilog/LICENSE.md @@ -0,0 +1,205 @@ +The `div_pipelined.v` file has been added from https://github.com/seldridge/verilog under the following license: + +```text + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within |