Added everything from the other system
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
`define CLOG2_VH
|
||||
|
||||
// Verilog-2001 compatible ceil(log2(x)) macro (matches $clog2 semantics).
|
||||
`ifndef CLOG2
|
||||
`define CLOG2(x) \
|
||||
(((x) <= 1) ? 0 : \
|
||||
((x) <= 2) ? 1 : \
|
||||
@@ -37,3 +38,4 @@
|
||||
((x) <= 2147483648) ? 31 : 32)
|
||||
|
||||
`endif
|
||||
`endif
|
||||
|
||||
16
cores/util/conv/conv.core
Normal file
16
cores/util/conv/conv.core
Normal file
@@ -0,0 +1,16 @@
|
||||
CAPI=2:
|
||||
|
||||
name: joppeb:util:conv:1.0
|
||||
description: Verilog conversion helper header
|
||||
|
||||
filesets:
|
||||
include:
|
||||
files:
|
||||
- conv.vh:
|
||||
is_include_file: true
|
||||
file_type: verilogSource
|
||||
|
||||
targets:
|
||||
default:
|
||||
filesets:
|
||||
- include
|
||||
16
cores/util/conv/conv.vh
Normal file
16
cores/util/conv/conv.vh
Normal file
@@ -0,0 +1,16 @@
|
||||
`ifndef CONV_VH
|
||||
`define CONV_VH
|
||||
|
||||
// =============================================================================
|
||||
// Convert Q1.15 to a biased UQ0.16 signal
|
||||
// =============================================================================
|
||||
function [15:0] q15_to_uq16;
|
||||
input [15:0] q15;
|
||||
reg [16:0] biased;
|
||||
begin
|
||||
biased = q15 + 17'sd32768;
|
||||
q15_to_uq16 = biased[15:0];
|
||||
end
|
||||
endfunction
|
||||
|
||||
`endif
|
||||
Reference in New Issue
Block a user