{"id":3584,"date":"2014-04-24T20:09:13","date_gmt":"2014-04-25T01:09:13","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/?p=3584"},"modified":"2014-05-12T08:42:26","modified_gmt":"2014-05-12T13:42:26","slug":"accelerating-the-simulink-debugger","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2014\/04\/24\/accelerating-the-simulink-debugger\/","title":{"rendered":"Accelerating the Simulink Debugger"},"content":{"rendered":"<!--introduction-->\r\n<p>This week I want to share a useful trick to save debugging time: <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/ug\/using-the-accelerator-mode-with-the-simulink-debugger.html\">Using the Simulink Debugger in Accelerator Mode<\/a>.<\/p>\r\n<!--\/introduction-->\r\n\r\n<p><strong>Simulink Debugger in Accelerator Mode<\/strong><\/p>\r\n\r\n<p>Did you know that the Simulink Debugger can run in Accelerator Mode? If you need to investigate a problem that happens late in a simulation, this can be very useful. This can help you reach the problem significantly faster than executing in normal mode.<\/p>\r\n\r\n<p>Start by setting your model to Accelerator Mode:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q2\/accelerator.png\" alt=\"configure the model for accelerator mode\" \/><\/p>\r\n\r\n<p>The functionality needed to toggle between accelerator and normal mode is accessible through the Simulink Debugger command line interface.<\/p>\r\n\r\n<p>At the MATLAB command prompt, try the following:<\/p>\r\n\r\n<ul>\r\n\t<li>Start the debugger using <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/sldebug.html\"><tt>sldebug<\/tt><\/a><\/li>\r\n\t<li>Set a time breakpoint using <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/tbreak.html\"><tt>tbreak<\/tt><\/a><\/li>\r\n\t<li>Simulate until the breakpoint is reached using <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/continue.html\"><tt>continue<\/tt><\/a><\/li>\r\n\t<li>To see which block methods are available, we can increase the execution tracing using <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/etrace.html\"><tt>etrace 3<\/tt><\/a><\/li>\r\n\t<li>While still in accelerator mode, <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/step_cmd.html\"><tt>step<\/tt><\/a> and observe that only model level methods are available<\/li>\r\n\t<li>Use <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/emode.html\"><tt>emode<\/tt><\/a> to switch to Normal mode<\/li>\r\n\t<li>After switching to Normal Mode, we can <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/step_cmd.html\"><tt>step<\/tt><\/a> block by block and observe data for each block<\/li>\r\n<\/ul>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q2\/cmdLineDebug.png\" alt=\"Switching between Accelerator and Normal debugging modes\" \/><\/p>\r\n\r\n<p><strong>Now it's your turn<\/strong><\/p>\r\n\r\n<p>Try accelerating your debugging and let us know how it goes by leaving a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=3584&#comment\">comment here<\/a>.<\/p>\r\n\r\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q2\/cmdLineDebug.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction-->\r\n<p>This week I want to share a useful trick to save debugging time: <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/ug\/using-the-accelerator-mode-with-the-simulink-debugger.html\">Using the Simulink Debugger in Accelerator Mode<\/a>.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2014\/04\/24\/accelerating-the-simulink-debugger\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[43],"tags":[381,380],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3584"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=3584"}],"version-history":[{"count":18,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3584\/revisions"}],"predecessor-version":[{"id":3664,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3584\/revisions\/3664"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=3584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=3584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=3584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}