Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. diff --git a/icetime/Makefile b/icetime/Makefile
  2. index b1cd18d..f268b99 100644
  3. --- a/icetime/Makefile
  4. +++ b/icetime/Makefile
  5. @@ -8,6 +8,8 @@ endif
  6.  
  7. all: icetime$(EXE)
  8.  
  9. +CHIPS=lp384 lp1k lp8k hx1k hx8k up5k
  10. +
  11. ifeq ($(EXE),.js)
  12. icetime$(EXE): | share/$(CHIPDB_SUBDIR)/chipdb-384.txt share/$(CHIPDB_SUBDIR)/chipdb-1k.txt share/$(CHIPDB_SUBDIR)/chipdb-8k.txt share/$(CHIPDB_SUBDIR)/chipdb-5k.txt
  13.  
  14. @@ -26,11 +28,11 @@ share/$(CHIPDB_SUBDIR)/chipdb-5k.txt: ../icebox/chipdb-5k.txt
  15. override LDFLAGS += --embed-file share
  16. endif
  17.  
  18. -icetime$(EXE): icetime.o iceutil.o
  19. +icetime$(EXE): icetime.o iceutil.o $(addsuffix .o, $(addprefix timings-, $(CHIPS)))
  20. $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS)
  21.  
  22. -icetime.o: icetime.cc timings.inc
  23. -iceutil.o: iceutil.cc
  24. +timings-%.cc: timings.py ../icefuzz/timings_*.txt
  25. + python3 timings.py $* > timings-$*.cc
  26.  
  27. timings.inc: timings.py ../icefuzz/timings_*.txt
  28. python3 timings.py > timings.inc.new
  29. diff --git a/icetime/icetime.cc b/icetime/icetime.cc
  30. index e7c0cd7..2feedfe 100644
  31. --- a/icetime/icetime.cc
  32. +++ b/icetime/icetime.cc
  33. @@ -746,7 +746,12 @@ const std::set<std::string> &get_inports(std::string cell_type)
  34. return inports_map.at(cell_type);
  35. }
  36.  
  37. -#include "timings.inc"
  38. +double get_delay_lp384(std::string cell_type, std::string in_port, std::string out_port);
  39. +double get_delay_lp1k(std::string cell_type, std::string in_port, std::string out_port);
  40. +double get_delay_lp8k(std::string cell_type, std::string in_port, std::string out_port);
  41. +double get_delay_hx1k(std::string cell_type, std::string in_port, std::string out_port);
  42. +double get_delay_hx8k(std::string cell_type, std::string in_port, std::string out_port);
  43. +double get_delay_up5k(std::string cell_type, std::string in_port, std::string out_port);
  44.  
  45. double get_delay(std::string cell_type, std::string in_port, std::string out_port)
  46. {
  47. diff --git a/icetime/timings.py b/icetime/timings.py
  48. index 7ac2a7b..604dbcd 100644
  49. --- a/icetime/timings.py
  50. +++ b/icetime/timings.py
  51. @@ -1,8 +1,10 @@
  52. #!/usr/bin/env python3
  53.  
  54. import re
  55. +import sys
  56.  
  57. print("// auto-generated by timings.py from ../icefuzz/timings_*.txt")
  58. +print("#include <string>")
  59.  
  60. def timings_to_c(chip, f):
  61. print("")
  62. @@ -47,6 +49,11 @@ def timings_to_c(chip, f):
  63. print(" exit(1);")
  64. print("}")
  65.  
  66. -for db in "lp384 lp1k lp8k hx1k hx8k up5k".split():
  67. +if len(sys.argv) >= 2:
  68. + chips = sys.argv[1:]
  69. +else:
  70. + chips = "lp384 lp1k lp8k hx1k hx8k up5k".split()
  71. +
  72. +for db in chips:
  73. with open("../icefuzz/timings_%s.txt" % db, "r") as f:
  74. timings_to_c(db, f);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement