URL
https://opencores.org/ocsvn/a-z80/a-z80/trunk
Subversion Repositories a-z80
Compare Revisions
- This comparison shows the changes necessary to convert path
/a-z80/trunk/tools/z80_pla_checker
- from Rev 3 to Rev 8
- ↔ Reverse comparison
Rev 3 → Rev 8
/source/ClassPLA.cs
21,6 → 21,11
public List<int> IgnoredPla = new List<int>(); |
|
/// <summary> |
/// List of PLA entries not used by our Timings matrix |
/// </summary> |
public List<int> NotUsedPla = new List<int>(); |
|
/// <summary> |
/// Returns the total number of PLA table entries |
/// </summary> |
public int Count() |
59,19 → 64,19
|
////============================================================ |
//// Ignore duplicate PLA entries |
//IgnoredPla.Add(98); // Duplicate of 37 |
//IgnoredPla.Add(94); // Duplicate of 12 and 18 |
//IgnoredPla.Add(93); // Duplicate of 11 and 19 |
//IgnoredPla.Add(90); // Duplicate of 26 |
//IgnoredPla.Add(36); // Duplicate of 8 |
//IgnoredPla.Add(87); // Duplicate of 83 |
//IgnoredPla.Add(71); // Duplicate of 25 |
//IgnoredPla.Add(63); // Duplicate of 17 |
//IgnoredPla.Add(87); // Duplicate of 83 |
//IgnoredPla.Add(60); // Duplicate of 15 |
//IgnoredPla.Add(94); // Duplicate of 12 and 18 |
//IgnoredPla.Add(18); // Duplicate of 12 and 94 |
//IgnoredPla.Add(93); // Duplicate of 11 and 19 |
//IgnoredPla.Add(19); // Duplicate of 11 and 93 |
//IgnoredPla.Add(98); // Duplicate of 37 |
//IgnoredPla.Add(41); // Duplicate of 3 |
//IgnoredPla.Add(36); // Duplicate of 8 |
//IgnoredPla.Add(32); // Duplicate of 4 |
//IgnoredPla.Add(19); // Duplicate of 11 and 93 |
//IgnoredPla.Add(18); // Duplicate of 12 and 94 |
|
////============================================================ |
//// Special signals (not instructions) |
83,15 → 88,13
//IgnoredPla.Add(28); // This signal specifies the OUT operation for PLA 37. Otherwise, it is operation. |
//IgnoredPla.Add(27); // This signal goes along individual IN/OUT instructions in the ED table. |
//IgnoredPla.Add(16); // This signal specifies a PUSH operation for PLA23. Otherwise, it is a POP operation. |
//IgnoredPla.Add(14); // This signal specifies a decrement operation for PLA 9. Otherwise, it is an increment. |
//IgnoredPla.Add(13); // This signal specifies whether the value is being loaded or stored for PLA entries 8, 30 and 38. |
//IgnoredPla.Add(4); // This signal goes along instructions that access I and R register (PLA 57 and 83). |
//IgnoredPla.Add(0); // This signal specifies *not* to repeat block instructions. |
|
////============================================================ |
//// Ignore our own reserved entries |
//IgnoredPla.Add(107); |
//IgnoredPla.Add(106); |
//IgnoredPla.Add(107); |
|
//============================================================ |
// Remove op-bits so we the output is more readable |
113,6 → 116,16
IgnoredPla.Add(76); |
|
//============================================================ |
// Signals not used in the Timings spreadsheet. For those, PLA table entries are not generated. |
// This list is used only when generating the PLA table. |
NotUsedPla.Add(67); // This signal defines a specific in(), but we use in/out pla[27] + pla[34] |
NotUsedPla.Add(62); // This signal is issued for all CB opcodes |
NotUsedPla.Add(54); // This signal specifies every CB with IX/IY |
NotUsedPla.Add(22); // This signal specifies CB prefix w/o IX/IY |
NotUsedPla.Add(14); // This signal specifies a decrement operation for PLA 9. Otherwise, it is an increment. |
NotUsedPla.Add(4); // This signal goes along instructions that access I and R register (PLA 57 and 83). |
|
//============================================================ |
// Mark all PLA entries we decided to ignore |
foreach (var p in pla) |
{ |
298,34 → 311,44
module += @"//=====================================================================================" + Environment.NewLine; |
module += @"// This file is automatically generated by the z80_pla_checker tool. Do not edit! " + Environment.NewLine; |
module += @"//=====================================================================================" + Environment.NewLine; |
module += @"module pla_decode (opcode, prefix, pla);" + Environment.NewLine; |
module += @"module pla_decode" + Environment.NewLine; |
module += @"(" + Environment.NewLine; |
module += @" input wire [6:0] prefix," + Environment.NewLine; |
module += @" input wire [7:0] opcode," + Environment.NewLine; |
module += @" output wire [" + max + ":0] pla" + Environment.NewLine; |
module += @");" + Environment.NewLine; |
module += @"" + Environment.NewLine; |
module += @"input wire [6:0] prefix;" + Environment.NewLine; |
module += @"input wire [7:0] opcode;" + Environment.NewLine; |
module += @"output reg [" + max + ":0] pla;" + Environment.NewLine; |
module += @"" + Environment.NewLine; |
module += @"always_comb" + Environment.NewLine; |
module += @"begin" + Environment.NewLine; |
|
foreach (var p in pla) |
{ |
if (p.IsDuplicate()) |
if (p.IsDuplicate() || NotUsedPla.Contains(p.N)) |
continue; |
|
String bitstream = p.GetBitstream(); |
module += string.Format(@" if ({{prefix[6:0], opcode[7:0]}} ==? 15'b{0}) pla[{1,3}]=1'b1; else pla[{1,3}]=1'b0; // {2}", |
bitstream, p.N, p.Comment) + Environment.NewLine; |
module += string.Format(@"assign pla[{0,3}] = (({{prefix[6:0], opcode[7:0]}} & 15'b{1}) == 15'b{2}) ? 1'b1 : 1'b0; // {3}", |
p.N, |
bitstream.Replace('0', '1').Replace('X', '0'), // Create "AND" mask |
bitstream.Replace('X', '0'), // Create a value to compare to |
p.Comment) + Environment.NewLine; |
} |
|
// Dump all PLA entries that are ignored |
// List all PLA entries that are not used |
module += @"" + Environment.NewLine; |
module += @" // Duplicate or ignored entries" + Environment.NewLine; |
module += @"// Entries not used by our timing matrix" + Environment.NewLine; |
foreach (var n in NotUsedPla) |
{ |
module += string.Format(@"assign pla[{0,3}] = 1'b0; // {1}", n, pla[n].Comment) + Environment.NewLine; |
} |
|
// List all PLA entries that are ignored |
module += @"" + Environment.NewLine; |
module += @"// Duplicate entries" + Environment.NewLine; |
foreach (var p in pla) |
{ |
if (p.IsDuplicate()) |
module += string.Format(@" pla[{0,3}]=1'b0; // {1}", p.N, p.Comment) + Environment.NewLine; |
module += string.Format(@"assign pla[{0,3}] = 1'b0; // {1}", p.N, p.Comment) + Environment.NewLine; |
} |
|
module += @"end" + Environment.NewLine; |
module += @"" + Environment.NewLine; |
module += @"endmodule" + Environment.NewLine; |
|
/z80_pla_checker.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream