42 input mclk,
// system clock, posedge 43 input xclk,
// half frequency (80 MHz nominal) 44 input we,
// registers write enable (@negedge mclk) 45 input [
4:
0]
wa,
// registers write address 46 input [
7:
0]
wd,
// write data 47 input start,
// start of the serail message 49 input start_char,
// serial character start (single pulse) 51 input ser_di,
// serial data in (LSB first) 52 input ser_stb,
// serial data strobe, single-cycle, first cycle after ser_di valid 53 output rdy,
// encoded nmea data ready 54 input rd_stb,
// encoded nmea data read strobe (increment address) 55 output [
15:
0]
rdata,
// encoded data (16 bits) 61 reg valid;
// so far it is a valid sentence 62 reg [
3:
0]
sentence1hot;
// one-hot sentence, matching first 6 bytes ($GPxxx) 63 reg restart;
// reset byte number if the first byte was not "$" 65 reg [
3:
0]
stb;
// ser_stb delayed 74 reg lsbs5;
// 5 LSBs during reading 3 last letters in $GPxxx 77 reg [
1:
0]
sentence;
// decoded sentence number (0..3) 80 reg [
4:
0]
format_field;
// current number of the field in the sentence 90 wire weof;
//asterisk, or cr/lf (<0x10) 97 reg [
1:
0]
extra_nibble;
// empty byte field - send two 4'hf nibbles 103 reg [
4:
0]
last_word_written;
// number of the last word (4 nibbles) written - used ro deassert rdy (garbage after) 110 assign debug[
23:
0] = {
1'b0,
131 //format_length_plus_7 240 // format_byte[0] - current format 254 //first_byte_in_field 279 // output buffer to hold up to 32 16-bit words. Written 1 nibble at a time 280 // replaced 6 RAM modules with inferred ones 298 // for each of the four sentences first byte - number of field (<=24), next 3 bytes - formats for each nmea filed (LSB first): 299 // 0 - nibble ("-" -> 0xd, "." -> 0xe), terminated with 0xf 300 // 1 - byte (2 nibbles), all bytes but last have MSB clear, last - set. 301 // No padding of nibbles to byte borders, bytes are encoded as 2 nibbles 306 // ROM to decode "$GP" 333 5'h18:
gp_exp_bit <=
1'b0;
//'h2c: "," - will use later - attach first comma to $GPxxx,
3789format_length_plus_7reg[4:0]
3792read_format_lengthreg
[0:31] 3820odbuf1_ramreg[3:0]
[0:3] 3823gpxxx_ramreg[3:0]
[0:31] 3822odbuf3_ramreg[3:0]
[0:3] 3824format_ramreg[7:0]
3786sentence1hot_priwire[3:1]
[0:31] 3819odbuf0_ramreg[3:0]
3788format_lengthreg[4:0]
3806first_byte_in_fieldreg
[0:31] 3821odbuf2_ramreg[3:0]
3813last_word_writtenreg[4:0]