Rotate
Modified by 2015.05.14
Design
Rotate
Version
1.0
Modified
2015-05-28
Source
IP-GUI

Function
Rotating an image by your given angle.
Give the first output after 1 cycle while the frame input ready.
Files
| Name | Function |
|---|---|
| Rotate.v | Main module |
| Rotate_TB.sv | Test bench |
| Multiplier13Sx20SRTT.xci | Xilinx IPCore file. |
| Multiplier13Sx20SRTT_funcsim.v | Model for functional simulation. |
| CosLUT.v | Source file. |
| SinLUT.v | Source file. |
| FixedRoundSigned2.v | Source file. |
| BRam8x512x512_funcsim.v | Simulation file. |
| FrameController.v | Simulation file. |
| FrameController2.v | Simulation file. |
| Multiplier12x12FR2_funcsim.v | Simulation file. |
Parameters
| Name | Type | Range | Default | Description |
|---|---|---|---|---|
| work_mode | unsigned | 0 for Pipeline, 1 for Req-ack | 0 | This module's working mode. |
| data_width | unsigned | None | 8 | Data bit width. |
| im_width | signed | 1 - 4096 | 320 | Width of image. |
| im_height | signed | 1 - 4096 | 240 | Height of image. |
| im_width_bits | unsigned | Depend on width of image | 9 | The bits of width of image. |
| mul_delay | unsigned | Depend on your multilpliers' configurations, 1 - 14 | 3 | Delay for multiplier. |
| ram_RL | unsigned | Depend on your FrameController | 7 | Delay for FrameController. |
Ports
| Name | Port | Type | Range | Default | Description |
|---|---|---|---|---|---|
| clk | input | unsigned | None | None | Clock. |
| rst_n | input | unsigned | None | None | Reset, active low. |
| angle | input | unsigned | 0 - 359 | None | Angle. |
| in_enable | input | unsigned | None | None | Input data enable, in pipeline mode, it works as another rst_n, in req-ack mode, only it is high will in_data can be really changes. |
| frame_in_ready | input | unsigned | None | None | Connect to out_ready in FrameController. |
| frame_in_data | input | unsigned | data_width - 1 : 0 | None | Connect to out_data in FrameController. |
| frame_enable | output | unsigned | None | None | Connect to in_enable in FrameController. |
| frame_out_count_x | output | unsigned | im_width_bits - 1 : 0 | None | Connect to in_count_u in FrameController. |
| frame_out_count_y | output | unsigned | im_width_bits - 1 : 0 | None | Connect to in_count_v in FrameController. |
| out_ready | output | unsigned | None | None | Output data ready, in both two mode, it will be high while the out_data can be read. |
| out_data | output | unsigned | data_width - 1 : 0 | None | Output data, it will be synchronous with out_ready. |
Instances
| Name | Type | Description |
|---|---|---|
| Sin | SinLUT | Getting sine of angle. |
| Cos | CosLUT | Getting cosine of angle. |
| MulX1 | Multiplier13Sx20SRTT | Multiplier for Unsigned 12bits x Signed 25bits, used for fixed multiplication.You can configure the multiplier by yourself, then change the "mul_delay".All Multiplier's pipeline stage must be same, you can not change the ports' configurations! |
| MulX2 | Multiplier13Sx20SRTT | Multiplier for Unsigned 12bits x Signed 25bits, used for fixed multiplication.You can configure the multiplier by yourself, then change the "mul_delay".All Multiplier's pipeline stage must be same, you can not change the ports' configurations! |
| MulY1 | Multiplier13Sx20SRTT | Multiplier for Unsigned 12bits x Signed 25bits, used for fixed multiplication.You can configure the multiplier by yourself, then change the "mul_delay".All Multiplier's pipeline stage must be same, you can not change the ports' configurations! |
| MulY2 | Multiplier13Sx20SRTT | Multiplier for Unsigned 12bits x Signed 25bits, used for fixed multiplication.You can configure the multiplier by yourself, then change the "mul_delay".All Multiplier's pipeline stage must be same, you can not change the ports' configurations! |
| FRSX1 | FixedRoundSigned2 | For rounding signed fixed number. |
| FRSX2 | FixedRoundSigned2 | For rounding signed fixed number. |
| FRSY1 | FixedRoundSigned2 | For rounding signed fixed number. |
| FRSY2 | FixedRoundSigned2 | For rounding signed fixed number. |
Simulations
Simulations for this module just support 512x512 and Gray-scale images !
Waves
Pipeline mode

ReqAck mode

Original
Results
Conf for testing:
| angle |
|---|
| 45 |
| 131 |
| 270 |

HDL functional simulation for pipeline mode is on the left, for req-ack mode is on the middle, and which on the right is the soft simulation
PSNR
| 1-131 | 1-270 | 1-45 | Total |
|---|---|---|---|
| 1000000.00 | 54.89 | 1000000.00 | 666684.96 |
Utilization
512x512, width of color is 8.
| Slice LUTs* | Slice Registers | DSP |
|---|---|---|
| 543 | 245 | 4 |
Timing
512x512, width of color is 8.
The max Data Path Delay is 4.414ns, so:
FMax = 226.55MHz
Thanks
The sources of images for simulations:
041-マツムシソウ