test case update
This commit is contained in:
@@ -35,7 +35,7 @@ SRCS += $(DPI_DIR)/float_dpi.cpp
|
||||
SRCS += $(SIM_DIR)/common/rvfloats.cpp
|
||||
SRCS += ./main.cpp
|
||||
|
||||
RTL_SRCS += $(RTL_DIR)/fpu/VX_tensor_core.sv
|
||||
RTL_SRCS += $(RTL_DIR)/fpu/VX_tensor_dpu.sv
|
||||
RTL_SRCS += $(RTL_DIR)/fpu/VX_tensor_tb.sv
|
||||
|
||||
TOP = VX_tensor_tb
|
||||
|
||||
@@ -33,7 +33,7 @@ $(PROJECT).dump: $(PROJECT).elf
|
||||
$(PROJECT).bin: $(PROJECT).elf
|
||||
$(CP) -O binary $(PROJECT).elf $(PROJECT).bin
|
||||
|
||||
$(PROJECT).elf: $(SRCS)
|
||||
$(PROJECT).elf: $(SRCS) $(DEPS)
|
||||
$(CC) $(CFLAGS) $(SRCS) $(LDFLAGS) -o $(PROJECT).elf
|
||||
|
||||
run-rtlsim: $(PROJECT).bin
|
||||
|
||||
@@ -86,8 +86,9 @@ expected_A = expected['A_array']
|
||||
expected_B = expected['B_array']
|
||||
expected_C = expected['C_array']
|
||||
expected_C = expected_C + expected_A @ expected_B
|
||||
|
||||
print(expected_C - C_array)
|
||||
print(expected_C[0:8, 0:8])
|
||||
print(C_array[0:8, 0:8])
|
||||
print((expected_C - C_array)[0:8, 0:8])
|
||||
|
||||
assert np.allclose(expected_A, A_array)
|
||||
assert np.allclose(expected_B, B_array)
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import numpy as np
|
||||
# A_array = np.random.rand(16, 8)
|
||||
# B_array = np.random.rand(8, 16)
|
||||
A_array = np.zeros((16, 8))
|
||||
B_array = np.zeros((8, 16))
|
||||
A_array[0,:] = 1.0
|
||||
B_array[:,0] = 1.0
|
||||
A_array = np.random.rand(16, 8)
|
||||
B_array = np.random.rand(8, 16)
|
||||
C_array = np.random.rand(16, 16)
|
||||
|
||||
# A_array = np.zeros((16, 8))
|
||||
# B_array = np.zeros((8, 16))
|
||||
# A_array[0,:] = 1.0
|
||||
# B_array[:,4] = 1.0
|
||||
# C_array = np.zeros((16, 16))
|
||||
# for i in range(16):
|
||||
# for j in range(16):
|
||||
# C_array[i,j] = i * 16 + j
|
||||
|
||||
with open('a_matrix.h', 'w') as f:
|
||||
for i in range(A_array.shape[0]):
|
||||
|
||||
Reference in New Issue
Block a user