dot_product

class caf_verilog.dot_product.DotProduct(x, y, x_i_bits=12, x_q_bits=0, y_i_bits=12, y_q_bits=0, output_dir='.')[source]

Bases: CafVerilogBase

gen_submodules()[source]
gen_tb()[source]
params_dict() dict[source]
template_dict(inst_name=None)[source]
write_dot_product_tb_module()[source]

Write out a testbench file to test the dot_product module.

Returns:

caf_verilog.dot_product.dot_product(a, b)[source]

Perform the dot product of a and b.

This method performs the dot product using a multiply and accumulate. Therefore, it is subject to Python 3’s int implementation rule when being used with quantized values.

Parameters:
  • a – Vector of length n.

  • b – Vector of length n.

Returns: