mirror of
https://github.com/aolofsson/oh.git
synced 2025-01-17 20:02:53 +08:00
MILESTONE: Yet another major revision of emesh protocol
-Remove formats and rally around 16bit CMD,simplicty over optimization! -Need to think of being scalable enough for 64bit memory and cache coherent systems!!!! The cost of this forward looking compatibility is only 8 bits, when compared to the 128 bits minimum of address/data pair, this is acceptable
This commit is contained in:
parent
558776a3b3
commit
7c05557e6f
@ -7,22 +7,24 @@
|
||||
*
|
||||
* The following table shows the field mapping for different AW's:
|
||||
*
|
||||
* | Packet | AW16 | AW32 | AW64 | AW128 |
|
||||
* |---------|---------|----------|-----------|---------|
|
||||
* | 7:0 | CMDL | CMDL | CMDL | CMDL |
|
||||
* | 39:8 | D/SA,DA | DA0 | DA0 | DA0 |
|
||||
* | 71:40 | **** | D0/SA1(0)| D0/SA1 | D0/SA1 |
|
||||
* | 103:72 | **** | D1/SA0 | D1/SA0 | D1/SA0 |
|
||||
* | 135:104 | **** | ***,CMDH | DA1 | DA1 |
|
||||
* | 167:136 | **** | ***,CMDH | D2/CMDH | D2/SA2 |
|
||||
* | 199:168 | *** | **** | D3 | D3/SA3 |
|
||||
* | 231:200 | **** | ***,CMDH | ***,CMDH | DA2 |
|
||||
* | 263:232 | **** | **** | **** | DA3 |
|
||||
* | 295:264 | **** | ***,CMDH | ***,CMDH | D4/CMDH |
|
||||
* | 327:296 | **** | **** | **** | D5 |
|
||||
* | 359:328 | **** | **** | **** | D6 |
|
||||
* | 391:360 | **** | **** | **** | D7 |
|
||||
* | 399:392 | **** | ***,CMDH | ***,CMDH | CMDH |
|
||||
* | Packet | AW16 | AW32 | AW64 | AW128 |
|
||||
* |---------|---------|----------|--------|---------|
|
||||
* | 15:0 | DA,CMD | CMD | CMD | CMD |
|
||||
* | 47:16 | D/SA,DA | DA0 | DA0 | DA0 |
|
||||
* | 79:48 | **** | D0/SA0 | D0/SA0 | D0/SA0 |
|
||||
* | 111:80 | **** | D1/0 | D1/SA1 | D1/SA1 |
|
||||
* |---------|---------|----------|--------|---------|
|
||||
* | 143:112 | **** | *** | DA1 | DA1 |
|
||||
* |---------|---------|----------|--------|---------|
|
||||
* | 167:144 | **** | *** | D2 | D2/SA2 |
|
||||
* | 207:176 | *** | **** | D3 | D3/SA3 |
|
||||
* | 239:208 | **** | **** | **** | DA2 |
|
||||
* | 271:240 | **** | **** | **** | DA3 |
|
||||
* |---------|---------|----------|--------|---------|
|
||||
* | 303:272 | **** | **** | *** | D4 |
|
||||
* | 335:304 | **** | **** | **** | D5 |
|
||||
* | 367:336 | **** | **** | **** | D6 |
|
||||
* | 399:368 | **** | **** | **** | D7 |
|
||||
*
|
||||
* The following list shows the widths supported for each AW
|
||||
*
|
||||
@ -36,14 +38,14 @@
|
||||
*
|
||||
* | Command[15:0] | 15:8 | 7 | 6:4 | 3:0 |
|
||||
* |-----------------|-------|----------|-------------|-------|
|
||||
* | WRITE-SINGLE | CH | NEAR/FAR | SIZE[2:0] | 0000 |
|
||||
* | WRITE-IRQ | CH | NEAR/FAR | SIZE[2:0] | 0001 |
|
||||
* | WRITE-START | CH | NEAR/FAR | SIZE[2:0] | 0010 |
|
||||
* | WRITE-STREAM | CH | NEAR/FAR | SIZE[2:0] | 0011 |
|
||||
* | WRITE-STOP | CH | NEAR/FAR | SIZE[2:0] | 0100 |
|
||||
* | WRITE-MULTICAST | | NEAR/FAR | SIZE[2:0] | 0101 |
|
||||
* | WRITE-IO | CH | NEAR/FAR | 64,DIR[1:0] | 0110 |
|
||||
* | TBD | CH | NEAR/FAR | SIZE[2:0] | 0111 |
|
||||
* | WRITE-SINGLE | CTRL | NEAR/FAR | SIZE[2:0] | 0000 |
|
||||
* | WRITE-IRQ | CTRL | NEAR/FAR | SIZE[2:0] | 0001 |
|
||||
* | WRITE-START | LEN | NEAR/FAR | SIZE[2:0] | 0010 |
|
||||
* | WRITE-STREAM | CTRL | STOP | CTRL | 0011 |
|
||||
* | WRITE-MULTICAST | | NEAR/FAR | SIZE[2:0] | 0100 |
|
||||
* | WRITE-IO | | NEAR/FAR | 64,DIR[1:0] | 0101 |
|
||||
* | TBD | | NEAR/FAR | SIZE[2:0] | 0110 |
|
||||
* | TBD | | NEAR/FAR | SIZE[2:0] | 0111 |
|
||||
* |-----------------|-------|----------|-------------|-------|
|
||||
* | READ | CH | NEAR/FAR | SIZE[2:0] | 1000 |
|
||||
* | ATOMIC-OP | CH | NEAR/FAR | SIZE[2:0] | 1001 |
|
||||
@ -89,20 +91,16 @@ module emesh2packet
|
||||
output [PW-1:0] packet_out
|
||||
);
|
||||
|
||||
//######################
|
||||
// PACKET COMMANDS
|
||||
//######################
|
||||
assign packet_out[7:0] = cmd_out[7:0];
|
||||
|
||||
//Selector for src/data field
|
||||
assign write = cmd_out[3];
|
||||
|
||||
generate
|
||||
//######################
|
||||
// 16-Bit
|
||||
//######################
|
||||
//############################
|
||||
// 16-Bit ("lite/apb like")
|
||||
//############################
|
||||
if(AW==16) begin : aw16
|
||||
if(PW==40) begin : p40
|
||||
assign packet_out[7:0] = cmd_out[7:0];
|
||||
assign packet_out[23:8] = dstaddr_out[15:0];
|
||||
assign packet_out[39:24] = write ? data_out[15:0]:
|
||||
srcaddr_out[15:0];
|
||||
@ -116,29 +114,18 @@ module emesh2packet
|
||||
// 32-Bit
|
||||
//######################
|
||||
if(AW==32) begin : aw32
|
||||
if(PW==72) begin: p72
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
if(PW==80) begin: p80
|
||||
assign packet_out[15:0] = cmd_out[15:0];
|
||||
assign packet_out[47:16] = dstaddr_out[31:0];
|
||||
assign packet_out[79:48] = write ? data_out[31:0] :
|
||||
srcaddr_out[31:0];
|
||||
end
|
||||
else if(PW==80) begin: p80
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[79:72] = cmd_out[15:8];
|
||||
end
|
||||
else if(PW==104) begin: p104
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = data_out[31:0];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
end
|
||||
else if(PW==112) begin: p112
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = data_out[31:0];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
assign packet_out[15:0] = cmd_out[15:0];
|
||||
assign packet_out[47:16] = dstaddr_out[31:0];
|
||||
assign packet_out[79:48] = write ? data_out[31:0] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[111:104] = cmd_out[15:8];
|
||||
assign packet_out[111:80] = data_out[63:32];
|
||||
end
|
||||
else begin: perror
|
||||
initial
|
||||
@ -149,41 +136,20 @@ module emesh2packet
|
||||
// 64-Bit
|
||||
//######################
|
||||
if(AW==64) begin : aw64
|
||||
if(PW==136) begin: p136
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
end
|
||||
else if(PW==144) begin: p144
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
assign packet_out[143:136] = cmd_out[15:8];
|
||||
end
|
||||
else if(PW==200) begin: p200
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
assign packet_out[199:136] = data_out[127:64];
|
||||
if(PW==144) begin: p144
|
||||
assign packet_out[15:0] = cmd_out[15:0];
|
||||
assign packet_out[47:16] = dstaddr_out[31:0];
|
||||
assign packet_out[111:48] = write ? data_out[63:0] :
|
||||
srcaddr_out[63:0];
|
||||
assign packet_out[143:112] = dstaddr_out[63:32];
|
||||
end
|
||||
else if(PW==208) begin: p208
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
assign packet_out[199:136] = data_out[127:64];
|
||||
assign packet_out[207:200] = cmd_out[15:8];
|
||||
assign packet_out[15:0] = cmd_out[15:0];
|
||||
assign packet_out[47:16] = dstaddr_out[31:0];
|
||||
assign packet_out[111:48] = write ? data_out[63:0] :
|
||||
srcaddr_out[63:0];
|
||||
assign packet_out[143:112] = dstaddr_out[63:32];
|
||||
assign packet_out[207:144] = data_out[127:64];
|
||||
end
|
||||
else begin: perror
|
||||
initial
|
||||
@ -194,49 +160,26 @@ module emesh2packet
|
||||
// 128-Bit
|
||||
//######################
|
||||
if(AW==128) begin : aw128
|
||||
if(PW==264) begin: p264
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
assign packet_out[199:136] = write ? data_out[127:64] :
|
||||
if(PW==272) begin: p272
|
||||
assign packet_out[15:0] = cmd_out[15:0];
|
||||
assign packet_out[47:16] = dstaddr_out[31:0];
|
||||
assign packet_out[111:48] = write ? data_out[63:0] :
|
||||
srcaddr_out[63:0];
|
||||
assign packet_out[143:112] = dstaddr_out[63:32];
|
||||
assign packet_out[207:144] = write ? data_out[127:64] :
|
||||
srcaddr_out[127:64];
|
||||
assign packet_out[263:200] = dstaddr_out[127:64];
|
||||
end
|
||||
else if(PW==272) begin: p272
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
assign packet_out[199:136] = write ? data_out[127:64] :
|
||||
srcaddr_out[127:64];
|
||||
assign packet_out[271:264] = cmd_out[15:8];
|
||||
end
|
||||
else if(PW==392) begin: p392
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
assign packet_out[199:136] = write ? data_out[127:64] :
|
||||
srcaddr_out[127:64];
|
||||
assign packet_out[391:264] = data_out[255:128];
|
||||
assign packet_out[271:208] = dstaddr_out[127:64];
|
||||
end
|
||||
else if(PW==400) begin: p400
|
||||
assign packet_out[39:8] = dstaddr_out[31:0];
|
||||
assign packet_out[71:40] = write ? data_out[31:0] :
|
||||
srcaddr_out[63:32];
|
||||
assign packet_out[103:72] = write ? data_out[63:32] :
|
||||
srcaddr_out[31:0];
|
||||
assign packet_out[135:104] = dstaddr_out[63:32];
|
||||
assign packet_out[199:136] = write ? data_out[127:64] :
|
||||
assign packet_out[15:0] = cmd_out[15:0];
|
||||
assign packet_out[47:16] = dstaddr_out[31:0];
|
||||
assign packet_out[111:48] = write ? data_out[63:0] :
|
||||
srcaddr_out[63:0];
|
||||
assign packet_out[143:112] = dstaddr_out[63:32];
|
||||
assign packet_out[207:144] = write ? data_out[127:64] :
|
||||
srcaddr_out[127:64];
|
||||
assign packet_out[399:392] = cmd_out[15:8];
|
||||
assign packet_out[271:208] = dstaddr_out[127:64];
|
||||
assign packet_out[399:272] = data_out[255:128];
|
||||
end
|
||||
else begin: perror
|
||||
initial
|
||||
|
Loading…
x
Reference in New Issue
Block a user