-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bsc: remove use of old-time
#721
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ $(warning Building unoptimized to work around a bug in GHC 9.2.1) | |
GHCOPTLEVEL ?= -O0 | ||
endif | ||
|
||
GHC += -Wtabs -fmax-pmcheck-models=800 | ||
GHC += -Wtabs -fmax-pmcheck-models=800 -freverse-errors | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this GHC flag change belong in this PR? |
||
|
||
# end ifeq ($(GHCMAJOR),9) | ||
else | ||
|
@@ -134,8 +134,6 @@ PACKAGES = \ | |
-package process \ | ||
-package filepath \ | ||
-package time \ | ||
-package old-time \ | ||
-package old-locale \ | ||
-package split \ | ||
-package syb \ | ||
-package integer-gmp \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,9 @@ import Data.List(nub, (\\), find, genericLength, sortBy, groupBy) | |
import Data.List.Split(wordsBy) | ||
import Data.Maybe(catMaybes, isJust, fromJust) | ||
import Data.Function(on) | ||
import Data.Time | ||
import Data.Time.Clock.POSIX | ||
import Control.Monad.State(runState) | ||
import System.Time -- XXX: in old-time package | ||
import qualified Data.Map as M | ||
|
||
import ErrorUtil(internalError) | ||
|
@@ -26,7 +27,6 @@ import VModInfo(vName_to_id) | |
import PPrint(ppReadable) -- hiding (int, char) | ||
import Util(concatMapM, mapFst, mapSnd) | ||
import SimFileUtils(codeGenOptionDescr) | ||
import TopUtils(TimeInfo(..)) | ||
import Version(versionname) | ||
import BuildVersion(buildVersion) | ||
|
||
|
@@ -35,13 +35,13 @@ import BuildVersion(buildVersion) | |
-- Create many .cxx and .h files from the entire list of SimCCBlocks | ||
-- and SimCCScheds. The blocks are grouped by module, the schedules | ||
-- cut across all modules. | ||
simBlocksToC :: Flags -> TimeInfo -> SBId -> | ||
simBlocksToC :: Flags -> Maybe UTCTime -> SBId -> | ||
(Maybe String) -> (Maybe String) -> | ||
SBMap -> ForeignFuncMap -> | ||
[String] -> [SimCCBlock] -> [SimCCSched] -> | ||
[SimCCClockGroup] -> SimCCGateInfo -> | ||
(String -> String -> IO String) -> IO [String] | ||
simBlocksToC flags time top_block def_clk def_rst | ||
simBlocksToC flags mcreation_time top_block def_clk def_rst | ||
sb_map ff_map reused mod_blocks scheds | ||
clk_groups gate_info writeFileC = do | ||
let sub_ids = [ i | sb <- M.elems sb_map, (i, _, _) <- sb_state sb ] | ||
|
@@ -95,7 +95,7 @@ simBlocksToC flags time top_block def_clk def_rst | |
|
||
let cvtModBlock = convertModuleBlock flags sb_map ff_map clk_map wdef_mod_map reused top_block | ||
module_names <- concatMapM (cvtModBlock writeFileC) mod_blocks | ||
schedule_names <- convertSchedules flags time top_block def_clk def_rst sb_map ff_map | ||
schedule_names <- convertSchedules flags mcreation_time top_block def_clk def_rst sb_map ff_map | ||
wdef_inst_map scheds clk_groups gate_info writeFileC | ||
return $ module_names ++ schedule_names | ||
|
||
|
@@ -207,12 +207,12 @@ convertModuleBlock flags sb_map ff_map clk_map wdef_mod_map reused top_blk write | |
writeFileC | ||
|
||
-- Convert the schedule and reset functions into .cxx and .h files | ||
convertSchedules :: Flags -> TimeInfo -> SBId -> | ||
convertSchedules :: Flags -> Maybe UTCTime -> SBId -> | ||
(Maybe String) -> (Maybe String) -> | ||
SBMap -> ForeignFuncMap -> M.Map String [AId] -> | ||
[SimCCSched] -> [SimCCClockGroup] -> SimCCGateInfo -> | ||
(String -> String -> IO String) -> IO [String] | ||
convertSchedules flags creation_time top_id def_clk def_rst sb_map ff_map | ||
convertSchedules flags mcreation_time top_id def_clk def_rst sb_map ff_map | ||
wdef_map scheds clk_groups gate_info writeFileC = do | ||
let ids = [] | ||
top_blk = lookupSB sb_map top_id | ||
|
@@ -489,12 +489,15 @@ convertSchedules flags creation_time top_id def_clk def_rst sb_map ff_map | |
get_creation_time = function (userType "time_t") | ||
(mkScopedVar "get_creation_time") | ||
[] | ||
(TimeInfo _ clock_time@(TOD t _)) = if (timeStamps flags) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove the flag check from here and put it in the caller? |
||
then creation_time | ||
else TimeInfo 0 (TOD 0 0) | ||
time_str = calendarTimeToString (toUTCTime clock_time) | ||
|
||
( time_str, time_secs ) = case mcreation_time of | ||
Nothing -> ( "1970-01-01 00:00:00 UTC", 0 ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be better to create a |
||
Just clock_time -> ( show clock_time | ||
, floor $ nominalDiffTimeToSeconds (utcTimeToPOSIXSeconds clock_time) | ||
) | ||
|
||
gct_def = define get_creation_time | ||
(comment time_str (ret (Just (mkUInt64 t)))) | ||
(comment time_str (ret (Just (mkUInt64 time_secs)))) | ||
version_methods = [ comment "Fill in version numbers" gv_def | ||
, comment "Get the model creation time" gct_def | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This accompanying comment would need to be removed too