Commit 6a7bb830 authored by Талибов Сэрхан Махмад Оглы's avatar Талибов Сэрхан Махмад Оглы
Browse files

Created graph and verilog generator. It probably works

1 merge request!12 of 4 services are donwe
Showing with 148 additions and 11 deletions
+148 -11
...@@ -14,11 +14,14 @@ ...@@ -14,11 +14,14 @@
<Compile Include="..\..\Shared\GraphTorus.cs" Link="GraphTorus.cs" /> <Compile Include="..\..\Shared\GraphTorus.cs" Link="GraphTorus.cs" />
<Compile Include="..\..\Shared\IRectangleLike.cs" Link="IRectangleLike.cs" /> <Compile Include="..\..\Shared\IRectangleLike.cs" Link="IRectangleLike.cs" />
<Compile Include="..\..\Shared\IRoundLike.cs" Link="IRoundLike.cs" /> <Compile Include="..\..\Shared\IRoundLike.cs" Link="IRoundLike.cs" />
<Compile Include="..\..\Shared\ProjectGenerator.cs" Link="ProjectGenerator.cs" />
<Compile Include="..\..\Shared\ProjectSettings.cs" Link="ProjectSettings.cs" /> <Compile Include="..\..\Shared\ProjectSettings.cs" Link="ProjectSettings.cs" />
<Compile Include="..\..\Shared\Settings.cs" Link="Settings.cs" /> <Compile Include="..\..\Shared\Settings.cs" Link="Settings.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Npgsql" Version="9.0.3" />
<PackageReference Include="System.Management" Version="9.0.2" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.2" /> <PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.2" />
</ItemGroup> </ItemGroup>
......
using System; using System;
using System.Diagnostics;
using System.Reflection.Metadata;
using System.Text.Json; using System.Text.Json;
using System.Xml.Linq; using System.Xml.Linq;
...@@ -130,7 +132,7 @@ namespace HDLNoCGen ...@@ -130,7 +132,7 @@ namespace HDLNoCGen
graph_filename += $"{info_width}_bit"; graph_filename += $"{info_width}_bit";
switch (graph.id()) switch (graph.graphId)
{ {
case GraphType.Circulant: case GraphType.Circulant:
graph_filename += "__circulant"; graph_filename += "__circulant";
...@@ -145,7 +147,7 @@ namespace HDLNoCGen ...@@ -145,7 +147,7 @@ namespace HDLNoCGen
graph_filename += $"_{graph.node_count}_" + String.Join("_", graph.generators.Select(s => $"{s}")); graph_filename += $"_{graph.node_count}_" + String.Join("_", graph.generators.Select(s => $"{s}"));
break; break;
default: default:
Console.WriteLine($"Graph type {graph.id} was not implemented into this switch statement."); Console.WriteLine($"Graph type {graph.graphId} was not implemented into this switch statement.");
Environment.Exit(1); Environment.Exit(1);
break; break;
} }
...@@ -203,7 +205,7 @@ namespace HDLNoCGen ...@@ -203,7 +205,7 @@ namespace HDLNoCGen
case "xy": case "xy":
graph_filename += "__xy"; graph_filename += "__xy";
switch (graph.id()) switch (graph.graphId)
{ {
case GraphType.Mesh: case GraphType.Mesh:
parameters.algorithm = RouterOptions.Algorithm.XY; parameters.algorithm = RouterOptions.Algorithm.XY;
...@@ -212,7 +214,7 @@ namespace HDLNoCGen ...@@ -212,7 +214,7 @@ namespace HDLNoCGen
parameters.algorithm = RouterOptions.Algorithm.XY; parameters.algorithm = RouterOptions.Algorithm.XY;
break; break;
default: default:
Console.WriteLine($"Graph type {graph.id} was not implemented into this switch statement."); Console.WriteLine($"Graph type {graph.graphId} was not implemented into this switch statement.");
Environment.Exit(1); Environment.Exit(1);
break; break;
} }
...@@ -228,7 +230,7 @@ namespace HDLNoCGen ...@@ -228,7 +230,7 @@ namespace HDLNoCGen
break; break;
} }
switch (graph.id()) switch (graph.graphId)
{ {
case GraphType.Circulant: case GraphType.Circulant:
parameters.packet_width = 1 + graph.get_bits(graph.node_count) + info_width; parameters.packet_width = 1 + graph.get_bits(graph.node_count) + info_width;
...@@ -244,7 +246,7 @@ namespace HDLNoCGen ...@@ -244,7 +246,7 @@ namespace HDLNoCGen
graph.parameters = parameters; graph.parameters = parameters;
string json = ""; string json = "";
switch (graph.id()) switch (graph.graphId)
{ {
case GraphType.Circulant: case GraphType.Circulant:
json = JsonSerializer.Serialize<GraphCirculant>(graph as GraphCirculant, new JsonSerializerOptions { WriteIndented = true }); json = JsonSerializer.Serialize<GraphCirculant>(graph as GraphCirculant, new JsonSerializerOptions { WriteIndented = true });
...@@ -257,10 +259,42 @@ namespace HDLNoCGen ...@@ -257,10 +259,42 @@ namespace HDLNoCGen
break; break;
} }
using (StreamWriter sw = new StreamWriter($"{location}/{graph_filename}.json")) using (StreamWriter sw = new StreamWriter($"{location}/graph_object_serialized.json"))
{ {
sw.Write(json); sw.Write(json);
} }
if (!create_verilog)
{
Environment.Exit(0);
}
Tuple<string, Process, Process> preparation_result = ProjectGenerator.routerPreparation(graph, "NoC_description", location, parameters);
string verilog_path = preparation_result.Item1;
Process compile_process = preparation_result.Item2;
Process simulate_process = preparation_result.Item3;
graph.createNoC(verilog_path, parameters);
StreamReader sr = new StreamReader($"{location}\\graph_object_serialized.json");
string json_deser = sr.ReadToEnd();
sr.Close();
GraphDeserializer des_graph_test = JsonSerializer.Deserialize<GraphDeserializer>(json_deser);
Graph graph_des;
switch (des_graph_test.graphId)
{
case GraphType.Circulant:
graph_des = new GraphCirculant(des_graph_test);
break;
case GraphType.Mesh:
graph_des = new GraphMesh(des_graph_test);
break;
case GraphType.Torus:
graph_des = new GraphTorus(des_graph_test);
break;
}
} }
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"profiles": { "profiles": {
"Graph_verilog_generator": { "Graph_verilog_generator": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "m 3 3" "commandLineArgs": "m 3 3 -v"
} }
} }
} }
\ No newline at end of file
...@@ -8,12 +8,71 @@ ...@@ -8,12 +8,71 @@
".NETCoreApp,Version=v8.0": { ".NETCoreApp,Version=v8.0": {
"Graph_verilog_generator/1.0.0": { "Graph_verilog_generator/1.0.0": {
"dependencies": { "dependencies": {
"Npgsql": "9.0.3",
"System.Management": "9.0.2",
"System.Security.Cryptography.ProtectedData": "9.0.2" "System.Security.Cryptography.ProtectedData": "9.0.2"
}, },
"runtime": { "runtime": {
"Graph_verilog_generator.dll": {} "Graph_verilog_generator.dll": {}
} }
}, },
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
"runtime": {
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
"assemblyVersion": "8.0.0.0",
"fileVersion": "8.0.1024.46610"
}
}
},
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.2"
},
"runtime": {
"lib/net8.0/Microsoft.Extensions.Logging.Abstractions.dll": {
"assemblyVersion": "8.0.0.0",
"fileVersion": "8.0.1024.46610"
}
}
},
"Npgsql/9.0.3": {
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "8.0.2"
},
"runtime": {
"lib/net8.0/Npgsql.dll": {
"assemblyVersion": "9.0.3.0",
"fileVersion": "9.0.3.0"
}
}
},
"System.CodeDom/9.0.2": {
"runtime": {
"lib/net8.0/System.CodeDom.dll": {
"assemblyVersion": "9.0.0.0",
"fileVersion": "9.0.225.6610"
}
}
},
"System.Management/9.0.2": {
"dependencies": {
"System.CodeDom": "9.0.2"
},
"runtime": {
"lib/net8.0/System.Management.dll": {
"assemblyVersion": "9.0.0.2",
"fileVersion": "9.0.225.6610"
}
},
"runtimeTargets": {
"runtimes/win/lib/net8.0/System.Management.dll": {
"rid": "win",
"assetType": "runtime",
"assemblyVersion": "9.0.0.2",
"fileVersion": "9.0.225.6610"
}
}
},
"System.Security.Cryptography.ProtectedData/9.0.2": { "System.Security.Cryptography.ProtectedData/9.0.2": {
"runtime": { "runtime": {
"lib/net8.0/System.Security.Cryptography.ProtectedData.dll": { "lib/net8.0/System.Security.Cryptography.ProtectedData.dll": {
...@@ -30,6 +89,41 @@ ...@@ -30,6 +89,41 @@
"serviceable": false, "serviceable": false,
"sha512": "" "sha512": ""
}, },
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-3iE7UF7MQkCv1cxzCahz+Y/guQbTqieyxyaWKhrRO91itI9cOKO76OHeQDahqG4MmW5umr3CcCvGmK92lWNlbg==",
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.2",
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.2.nupkg.sha512"
},
"Microsoft.Extensions.Logging.Abstractions/8.0.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-nroMDjS7hNBPtkZqVBbSiQaQjWRDxITI8Y7XnDs97rqG3EbzVTNLZQf7bIeUJcaHOV8bca47s1Uxq94+2oGdxA==",
"path": "microsoft.extensions.logging.abstractions/8.0.2",
"hashPath": "microsoft.extensions.logging.abstractions.8.0.2.nupkg.sha512"
},
"Npgsql/9.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-tPvY61CxOAWxNsKLEBg+oR646X4Bc8UmyQ/tJszL/7mEmIXQnnBhVJZrZEEUv0Bstu0mEsHZD5At3EO8zQRAYw==",
"path": "npgsql/9.0.3",
"hashPath": "npgsql.9.0.3.nupkg.sha512"
},
"System.CodeDom/9.0.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-VnlzS7afE8LaXXwKdHOe2D6FcDekqThzU1E67CONV7gp71q3zposqcSeXH+PxARMXC5j31efwXrxP8VGvD70Ug==",
"path": "system.codedom/9.0.2",
"hashPath": "system.codedom.9.0.2.nupkg.sha512"
},
"System.Management/9.0.2": {
"type": "package",
"serviceable": true,
"sha512": "sha512-U6SXFe1kfJySAvcPPdbdb+fycaY+3c/KV0PwTjurvrALMnlSm37s5z8zcoI7qbkV2kYhxiLfsZRGiF0XeSsqSQ==",
"path": "system.management/9.0.2",
"hashPath": "system.management.9.0.2.nupkg.sha512"
},
"System.Security.Cryptography.ProtectedData/9.0.2": { "System.Security.Cryptography.ProtectedData/9.0.2": {
"type": "package", "type": "package",
"serviceable": true, "serviceable": true,
......
No preview for this file type
No preview for this file type
No preview for this file type
File added
File added
File added
...@@ -14,7 +14,7 @@ using System.Reflection; ...@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Graph_verilog_generator")] [assembly: System.Reflection.AssemblyCompanyAttribute("Graph_verilog_generator")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+272b3d7e1e9abd8e8a16683e8f351ddb6cabeaea")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d2c203d1da20da1aa35357c263f95dc4afa23a7a")]
[assembly: System.Reflection.AssemblyProductAttribute("Graph_verilog_generator")] [assembly: System.Reflection.AssemblyProductAttribute("Graph_verilog_generator")]
[assembly: System.Reflection.AssemblyTitleAttribute("Graph_verilog_generator")] [assembly: System.Reflection.AssemblyTitleAttribute("Graph_verilog_generator")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
......
468b0036dc2f8e0061ba836a5e35526a8653437a0e1763c66abb79c227417e3d 9d61c0adbe19322d1b29e1e202e3cbeeae3abc5f5a2607646d86c0d118d22327
No preview for this file type
f6c5c7b17231157bb2498b74ee536b8f9abc4fff728c562cb3517c2543ce1b4a e7071536c5377f8f0443445525384c7927a67b0f4e906f7eeaefe3ec83130048
...@@ -15,3 +15,9 @@ D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\ ...@@ -15,3 +15,9 @@ D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\Debug\net8.0\Graph_verilog_generator.pdb D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\Debug\net8.0\Graph_verilog_generator.pdb
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\Debug\net8.0\Graph_verilog_generator.genruntimeconfig.cache D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\Debug\net8.0\Graph_verilog_generator.genruntimeconfig.cache
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\Debug\net8.0\ref\Graph_verilog_generator.dll D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\obj\Debug\net8.0\ref\Graph_verilog_generator.dll
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\bin\Debug\net8.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\bin\Debug\net8.0\Microsoft.Extensions.Logging.Abstractions.dll
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\bin\Debug\net8.0\Npgsql.dll
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\bin\Debug\net8.0\System.CodeDom.dll
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\bin\Debug\net8.0\System.Management.dll
D:\Project1718\Microservice\Graph_verilog_generator\Graph_verilog_generator\bin\Debug\net8.0\runtimes\win\lib\net8.0\System.Management.dll
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment