end else if (count_out==0 && `in_full) begin
`drain_in
data_to_host_full_word <= in_d;
- count_out <= 6;
+ count_out <= 8;
end else if (count_out!=0 && !data_to_host_full && !data_to_host_write_enable) begin
- data_to_host <= data_to_host_full_word[7:0];
- data_to_host_full_word <= (data_to_host_full_word >> 8);
+ data_to_host <= { 2'b0, data_to_host_full_word[5:0] };
+ data_to_host_full_word <= (data_to_host_full_word >> 6);
data_to_host_write_enable <= 1;
count_out <= count_out-1;
end
while(true) {
long result = 0;
int val = 0;
- for(int i=0; i<6; i++) {
+ for(int i=0; i<8; i++) {
val = is.read();
if (val==-1) break;
long val2 = (val & 0xffL);
- val2 = val2 << (i * 8);
+ val2 = val2 << (i * 6);
result |= val2;
}
if (val==-1) break;