// rot_sim.cpp
// 2019/06/15 by marsee
//
#include <ap_int.h>
#include "ap_utils.h"
#define WAIT_COUNT 10
int rot_sim(ap_uint<1> rev, volatile ap_uint<1> &sa, volatile ap_uint<1> &sb){
#pragma HLS INTERFACE ap_none port=sb
#pragma HLS INTERFACE ap_none port=sa
if(rev == 0){ // Normal rotation
sa = 0; sb = 0;
ap_wait_n(WAIT_COUNT);
sa = 1; sb = 0;
ap_wait_n(WAIT_COUNT);
sa = 1; sb = 1;
ap_wait_n(WAIT_COUNT);
sa = 0; sb = 1;
ap_wait_n(WAIT_COUNT);
}else{
sa = 0; sb = 0;
ap_wait_n(WAIT_COUNT);
sa = 0; sb = 1;
ap_wait_n(WAIT_COUNT);
sa = 1; sb = 1;
ap_wait_n(WAIT_COUNT);
sa = 1; sb = 0;
ap_wait_n(WAIT_COUNT);
}
return(0);
}
// rot_sim_tb.cpp
// 2019/06/15 by marsee
//
#include <ap_int.h>
int rot_sim(ap_uint<1> rev, ap_uint<1> &sa, ap_uint<1> &sb);
int main(){
ap_uint<1> sa, sb;
rot_sim(0, sa, sb);
rot_sim(1, sa, sb);
return(0);
}
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
- | - | - | - | - | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | - | - | - | - | - | - |