ready for demo

This commit is contained in:
Yehowshua Immanuel 2024-03-20 03:30:28 -04:00
parent 83f78d1c3d
commit 10ed5b8751
3 changed files with 20 additions and 13 deletions

View file

@ -21,12 +21,13 @@ module mkCore(Core#(clkFreq));
Real val = fromInteger(clkFreqInt);
messageM("mkCore clkFreq" + realToString(val));
rule second_counter;
Bool pulse_every_second = counter == clkFreqUInt;
rule count;
counter <= (counter == clkFreqUInt) ? 0 : counter + 1;
tick_second <= True;
endrule
rule update_led(tick_second);
rule counting_led(pulse_every_second);
led_out <= led_out + 1;
endrule
@ -37,7 +38,9 @@ module mkCore(Core#(clkFreq));
return led_out;
endmethod
method Action put_char(Bit#(8) byte_in);
uart_out <= byte_in;
Bit#(8) value = byte_in;
uart_out <= value;
// led_out <= value;
endmethod
endmodule

View file

@ -41,6 +41,8 @@ module mkDeserialize#(Handle fileHandle)(IDeserializer#(clkFreq, baudRate));
shiftReg <= {ftdiRxIn, shiftReg[7:1]};
endrule
// an invariant enforced here is we can't call this method
// until shift reg is valid
method Bit#(8) get() if (ftdiState == STOP && clkDivider.isAdvancing());
return shiftReg;
endmethod

View file

@ -43,15 +43,17 @@ module mkTop(ITop);
messageM("Hallo!!" + realToString(5));
// connect up core device
rule core_led_o;
persist_led <= core.get_led;
endrule
rule core_char_device_o;
serializer.putBit8(core.get_char);
endrule
rule core_char_device_i;
core.put_char(deserializer.get);
endrule
rule core_led_o;
persist_led <= core.get_led;
endrule
rule core_char_device_o;
serializer.putBit8(core.get_char);
endrule
rule core_char_device_i;
core.put_char(deserializer.get);
endrule
// output methods
method Bit#(1) ftdi_rxd;